如何在另一个 modalViewController 退出后更新 modalViewController
我有一个当用户单击按钮(UIModalPresentationFormSheet)时呈现的视图。该视图上有 4 个文本字段,单击一个按钮会在顶部弹出另一个 (UIModalPresentationFormSheet) 视图。该视图唯一拥有的就是一个选择器。当选择一个条目时,用户就会返回到上一个视图。我想在此之后在原始视图上显示此条目,但我不确定如何更新以前的视图,因为未调用方法“ViewWillAppear”和“ViewDidAppear”。当顶部的模态视图退出时,有没有办法将事件发送到原始模态视图?这样,一旦选择器视图被丢弃,我就可以更新原始标签的文本。
I have a view that is presented when a user clicks on a button (a UIModalPresentationFormSheet). This view has 4 text fields on them, and one button that when clicked pops another (UIModalPresentationFormSheet) view on top. The only thing that this view has is a picker. When an entry is picked, the user then goes back to the previous view. I want to display this entry on the original view after this, but I'm not sure how to update the previous view since the method "ViewWillAppear" and "ViewDidAppear" are not called. Is there a way to send an event to the original modal view when a modal view on top has exited? This way I can update the text of a label from the original once that picker view is discarded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以使用委派。
you can always use delegation.