3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Segue で tableview の cell の中身を渡す時の Segueの設定の仕方

Last updated at Posted at 2015-09-26

tableview のcellの中身を渡す場合は storyboardのtableview から遷移先にsegueをつなぐのではなく 遷移元の ViewController から遷移先のViewControllerにsegueをつないでIdentifierを設定。

swift
func tableView(tableView: UITableView,
        didSelectRowAtIndexPath indexPath: NSIndexPath)

swift
performSegueWithIdentifier("", sender: indexPath)

を指定。

swift
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

で値を渡す。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?