Reputation: 520
I'm building an app on iOS, but I'm still confused about how to use table view as the button that triggers segue to a search modal view like in the screenshot. Do I have to use regular table view cell and then returns custom number of items in section or how?
Upvotes: 0
Views: 75
Reputation: 4050
First, you wire up a segue from your tableView controller to you modal view controller in your storyboard and provide an identifier for the segue, then you can have your tableView controller conform to UITableViewDelegate protocol and implement tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
method. Inside the implementation of that method, you call: performSegueWithIdentifier(identifier: String, sender: AnyObject?)
and pass in the identifier of the segue from your storyboard.
Upvotes: 1