简体   繁体   中英

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应用示例

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM