使用 PageCurl 关闭 ModalViewController
我有一个带有页面卷曲样式的模态视图控制器。一切工作正常,但是,如果我单击页面顶部卷曲的页面,模式视图将在没有任何输入的情况下被关闭。
现在,我可以接受这种行为,但当它发生时我需要做一些操作。我怎样才能抓住这个事件来做我的事情?
I've a modal view controller presented with page curl style. Everything works fine, but, if I click the page curled at top of the page, the modal view gets dismissed without any input.
Now, I could accept this behavior but I need to do some operation when it happens. How can I catch the event to do my stuff?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在谈论半页卷曲效果?如果是这样,您可能可以通过在正在执行呈现的 ViewController 中实现/覆盖以下方法来捕获它关闭模态视图的事件...
在调用 super 方法之前或之后进行操作,具体取决于您是否想要在视图关闭之前或之后执行它。我没有机会尝试这个,所以请告诉我它是否有效。
I assume you are talking about the half-page curl effect? If so, you could probably catch the event of it dismissing the modal view by implementing/overriding the following method in the ViewController that is doing the presenting...
Do your operation either before of after the call the the super method depending on if you want to execute it before or after the view is dismissed. I didn't get a chance to try this out so let me know if it works.