可可触摸–同时关闭模态视图控制器和弹出视图控制器
我怎样才能实现这个目标?基本上我有第一个列出一些项目的视图控制器,如果我触摸一个项目,它将在堆栈上推送另一个视图控制器以获取该项目的详细视图,然后如果我选择“编辑”,它将在该模式中呈现一个模式视图控制器视图控制器我可以选择删除该项目。如果我选择删除,我想关闭模式视图控制器并返回到项目列表。
为了清楚起见,ListViewController、DetailedViewController、EditViewController。
How can I achieve this? Basically I have first a view controller that lists some items, if I touch one Item it will push another viewcontroller on the stack for a detailed view of that item, then if I choose "edit" it will present a modal viewcontroller, in this modal view controller I have the option to delete the item. If I choose to delete I want to dismiss the modal view controller and be taken back to the lists of items.
So for clarity ListViewController, DetailedViewController, EditViewController.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议也使用DetailedViewController 进行编辑,例如Contacts.app。
如果您不想省略 EditViewController,那么您可以使用委托模式来解决它,该模式会在您关闭编辑控制器之前弹出DetailedViewController。
I would recommend using the DetailedViewController for editing as well, like the Contacts.app.
If you don't want to omit the EditViewController, then you could solve it with a delegate pattern, which pops the DetailedViewController before you dismiss the edit controller.