[英]How to transition to a view controller with gesture swift iOS
I have a problem with implementing a button which should redirect my current view to another view when tapping on it. 我在实现按钮时遇到问题,点击该按钮时应将当前视图重定向到另一个视图。 I have a central view and I already implement the gestures on top, left and right to move to others views.
我有一个中心视图,并且已经在顶部,左侧和右侧实现了手势以移动到其他视图。
But on this central view I want to add a button that allows me to redirect towards my right screen without using gesture from right to left with my finger. 但是在此中央视图上,我想添加一个按钮,使我无需使用手指从右到左的手势即可重定向到右侧屏幕。
I added an IBOutlet action for this button, but I do not know what method to implement for switching back to my right screen (not the top or left screen). 我为此按钮添加了IBOutlet操作,但我不知道要实现哪种方法来切换回我的右屏幕(而不是顶部或左侧屏幕)。
If anyone can help me thank you very much! 如果有人可以帮助我,非常感谢!
If you create a segue in Interface Builder and give it an identifier. 如果在Interface Builder中创建序列并为其提供标识符。 You can then perform this segue (what you call "a transition" ) by calling
然后,您可以通过调用以下命令执行此命令(称为“过渡” )
performSegue(withIdentifier: <String>, sender: self)
Of course you will need to replace <String>
with your segue's identifier 当然,您需要将
<String>
替换为segue的标识符
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.