[英]How to display exact copy of current ViewController when a button in current ViewController is clicked?
I want to display another ViewController
which must be copy of current ViewController
with same UI(empty new tab like in Safari) when a button is clicked in current ViewController
. 我想显示另一个
ViewController
,当在当前ViewController
单击按钮时,该ViewController
必须是具有相同UI(像Safari中一样为空的新标签)的当前ViewController
副本。 For clear understanding, when we click + button iOS Safari then new tab in Safari is opened. 为了清楚理解,当我们单击+按钮iOS Safari时,将打开Safari中的新标签页。 I want to include this feature in my project.
我想在我的项目中包含此功能。
Having a copy loaded is not like a new tab. 加载副本与新建标签不同。 You're looking to create a new instance of the same view controller.
您正在寻找创建相同视图控制器的新实例。 So, just instantiate it again with a new instance variable.
因此,只需使用新的实例变量再次实例化它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.