iOS and xcode: how to give a segue a “storyboard i

2019-07-05 03:09发布

I am wanting to create a modal segue from a view controller to an a new view, but not by linking the segue action to a button or anything. Instead, I'd like to just set the segue up so that I can call it in pageDidLoad and have it automatically execute if I want.

To do this, I need to be able to reference the segue, such as this:

[self performSegueWithIdentifier:@"mySegue" sender: ...];

After I control-click-drag a connection in storyboard to create a segue, how can I give it a name for later reference? Thanks!

2条回答
一夜七次
2楼-- · 2019-07-05 03:34

Link the segue action from curent viewController to new view controller. I think this you want, see the screenshot.

enter image description here

This link will help you for remaining code.

查看更多
女痞
3楼-- · 2019-07-05 03:52

Nevermind! In the details pane sidebar of xcode, under the third tab there is an "Identifier" field that can be filled out!

查看更多
登录 后发表回答