没有按钮连接以编程方式执行Segue? [英] Perform Segue Programmatically Without Button Connection?
本文介绍了没有按钮连接以编程方式执行Segue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的故事板中有两个视图控制器,我需要从视图1推送到视图2.
I have two view controllers in my storyboard and I need to push from view 1 to view 2.
我需要在不直接连接segue的情况下执行此操作我的故事板中的按钮,我需要以编程方式进行。
I need to do this without connecting a segue directly from a button in my storyboard, I need to do it programatically.
我该怎么办?
谢谢。
推荐答案
当您点击按钮电话时:
[self performSegueWithIdentifier:@"SegueIdentifier" sender:self];
您需要在故事板中创建segue,但您可以从视图控制器到视图控制器而不是按钮来查看控制器。
You will need to create the segue in the storyboard but you can do it from view controller to view controller instead of button to viewcontroller.
这篇关于没有按钮连接以编程方式执行Segue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文