我创建并呈现 UIActivityViewController
在我的应用程序中自定义 UIActivity
里面的元素。
当我点击 UIActivity
图标,UIActivityViewController
向下滑动并显示我的模态视图 Controller 。但是,当我解雇我的 VC 时,UIActivityViewController
出现。
按下事件项时,如何使其消失并且不再出现?
最佳答案
您需要调用activityDidFinish:
选择的方法UIActivity
.
来自 UIActivity activityDidFinish:
的文档:
Discussion
This method dismisses the sharing interface provided by theUIActivityViewController
object. If you provided a view controller using theactivityViewController
method, this method dismisses that view controller too.You must call this method after completing the work associated with this object’s service. This is true regardless of whether you used the
activityViewController
orperformActivity
method to initiate the service. When calling the method, use the Boolean value to indicate whether the service completed successfully.
关于ios - 何时以及如何关闭 UIActivityViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15479897/