私はUISearchControllerを実装する作業テーブルビューを持っています。今、私はinstagram、twitterのような検索アクションの開始前後に2つの異なるテーブルビューを表示したいと思います。最近の検索結果を一覧表示する別のテーブルビューを表示したい。swift:検索前/後に別のテーブルビューを表示するUISearchcontroller
マイストーリーボードのセットアップは次のとおりです。
- >タブバー - >ナビゲーションバー - > SearchResultsTableViewController - >ナビゲーションバー - > recentSearchesTableView
私はsearchResultsTableViewで検索バーを持っています。
class SearchResultsTableViewController: UITableViewController, SearchTableViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
if ((self.searchResults?.count) == 0) {
performSegueWithIdentifier("ShowSearchView", sender: self)
}
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "ShowSearchView" {
if let destinationNavigation = segue.destinationViewController as? UINavigationController {
if destinationNavigation.viewControllers.count > 0 {
if let searchVC = destinationNavigation.viewControllers[0] as? SearchTableViewController {
searchVC.delegate = self
}
}
}
}
}
セグを使用せずにこれを実現する方法はありますか?
を使用していた知っているので、セクションの分周器は、しかし、あなたが望む見えるようにすることができますが... ありがとうございました –