UIViewImage push to new UIViewController IN STORYBOARD

丶灬走出姿态 提交于 2019-12-11 20:53:48

问题


From questions like this and this, I know how to have a UIViewImage push to a new UIViewController programatically.

But how can I do this in completely in Storyboard? I like Storyboard and would like to not have multiple xib files everywhere.

I've already enable User Interaction through Storyboard, but I still can't create a transition...


回答1:


  1. Drag UIViewController object onto your Storyboard canvas
  2. Select that ViewController and in the top menu bar, click Editor > Embed in > Navigation Controller.
  3. Drag another UIViewController onto the Storyboard
  4. Control drag from the first UIViewController to the new UIViewController and select push from the resulting options.
  5. Click on the Segue that is created and go to the Attributes inspector and enter an Identifier for the Segue.
  6. In the ViewController code where you're handling the UIImageView tap, call [self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self];


来源:https://stackoverflow.com/questions/17974898/uiviewimage-push-to-new-uiviewcontroller-in-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!