rony
rony

Reputation: 520

Use Table View as segue button on iOS

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?

iOS app example

Upvotes: 0

Views: 75

Answers (1)

Ahmed Onawale
Ahmed Onawale

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

Related Questions