私はtableViewから検索してセルをタップした後にcollectionViewを表示したいと思います。ViewControllerを使用せずに表示する方法Seque
また、tableViewControllerであるsearchControllerを作成し、updateSearchResultsForSearchController()を実装します。これはうまく動作し、私が望む結果を表示します。
ストーリーボードがsearchControllerを持っていないので、私はsearchController間のセグエを作成することはできませんし、私が試したcollectionViewController.Whatは
//PostListId is the storyboard id of postList(collectionview here)
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// Choose the viewController I wanna display
let postList = storyboard?.instantiateViewControllerWithIdentifier("PostListId") as! PostListController
// Send data to collectionView
postList.key = 1
// PresentViewController
self.presentViewController(postList, animated: true, completion: nil)
}
である。しかし、私は、検索した後、セルをタップすると、私が得ましたここではエラーが表示され、エラーメッセージのフィードバックは表示されません。
必要に応じてストーリーボードシーンを使用できます。 View Controllerカスタムタイプを適切に設定するだけです – Paulw11