iPhone完全复制/复制视图控制器
我有一个视图控制器,其中包含文本/图像/位置数据等用户内容,我想复制 viewController 并在用户点击编辑按钮时以模态方式呈现它(presentModalViewController)。这样做的原因是因为我希望清楚用户正在通过使用模态呈现的控制器附带的过渡/动画进入编辑模式。
有谁知道如何复制整个 viewController + 它的视图?我不想要重新分配整个 viewController 的开销。我尝试了几件事,但没有任何运气。
欢迎任何帮助/信息。
I have a view controller with user content like text/images/location data and i would like to duplicate the viewController and present it modally (presentModalViewController) when the user taps the edit button. The reason for doing this is because i want it to be clear that the user is entering the edit mode by using the transition/animation that comes with a modally presented controller.
Does anybody knows how to duplicate an entire viewController + its view? i don't want the overhead of reallocating the entire viewController. I tried a couple of things, but i haven't had any luck.
Any help/information would be welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这听起来有点不切实际。您可以制作当前屏幕内容的图像,在所有内容之上使用您喜欢的任何动画来呈现该图像,然后将其删除?
或者在 viewController 的
setEditing:animated:
方法中对视图进行其他更改(视图的重新排列、其他控件的外观、颜色的更改)。That sounds a little impractical. You could make an image of the current screen contents, present that using whatever animation you like on top of everything, and then remove it?
Or make other changes to your view (rearrangement of views, appearance of other controls, changes of colour) in your viewController's
setEditing:animated:
method.