UISearchController
に2つの問題があります。 私はUISearchControllerために、この設定を使用します。選択項目検索バーがまだ表示されているときにSwift UISearchController
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!)
}
まず問題、私は、検索バーのテキストフィールドにUIRefreshControl
ショーをクリックしますが、それはいけない
:
セカンドを問題
私がアイテムを検索してクリックすると、Storyboard segueを使用して新しいviewcontrollerでそのアイテムを開きますが、問題はその新しいVCにまだ検索バーがあることです(最初のイメージが検索され、 ):
次の画面 – Birendra
に移動befor検索バーのテキストフィールドをcleareする必要があります - (ボイド)searchBarCancelButtonClicked:(UISearchBar *)検索バー { searchBar.text = @ ""; } – Birendra
しかし、これは私がクリックしているキャンセルボタンではありません –