Ich habe zwei Probleme mit UISearchController
. ich dieses Setup verwenden für UISearchController:Swift UISearchController wenn Element suchen Suchleiste ist immer noch
var resultSearchController = UISearchController(searchResultsController: nil)
override func viewDidLoad() {
super.viewDidLoad()
resultSearchController = UISearchController(searchResultsController: nil)
resultSearchController.searchResultsUpdater = self
resultSearchController.dimsBackgroundDuringPresentation = false
resultSearchController.hidesNavigationBarDuringPresentation = false
resultSearchController.searchBar.placeholder = "Traži.."
resultSearchController.searchBar.sizeToFit()
tableView.tableHeaderView = resultSearchController.searchBar
refreshControl = UIRefreshControl()
refreshControl!.attributedTitle = NSAttributedString(string: "Učitaj podatke..")
refreshControl!.backgroundColor = UIColor(red:1, green:0.48, blue:0, alpha:0.3)
refreshControl!.tintColor = UIColor.whiteColor()
refreshControl!.addTarget(self, action: #selector(ArticleTableViewController.getArticleData), forControlEvents: UIControlEvents.ValueChanged)
tableView.addSubview(refreshControl!)
}
Erstes Problem
wenn ich auf Suchleiste Textfeld, UIRefreshControl
zeigt aber es sollte nicht:
Zweite Problem
Wenn ich nach einem Element suche und darauf klicke, benutze ich das Storyboard-Segment, um das Element im neuen Viewcontroller zu öffnen, aber das Problem ist, dass die Suchleiste immer noch auf dem neuen VC vorhanden ist (das erste Bild sucht, das zweite Bild zeigt das neue VC geöffnet)):
Sie die Suchleiste Textfeld vor dem Bewegen zum nächsten Bildschirm – Birendra
CLEARE haben - (void) searchBarCancelButtonClicked: (UISearchBar *) SearchBar { searchBar.text = @ ""; } – Birendra
Aber dies ist nicht Abbrechen Schaltfläche, die ich klicke –