ios - 何时以及如何关闭 UIActivityViewController

标签 ios objective-c cocoa-touch ios6 uikit

我创建并呈现 UIActivityViewController在我的应用程序中自定义 UIActivity里面的元素。

当我点击 UIActivity图标,UIActivityViewController向下滑动并显示我的模态视图 Controller 。但是,当我解雇我的 VC 时,UIActivityViewController出现。

按下事件项时,如何使其消失并且不再出现?

最佳答案

您需要调用activityDidFinish:选择的方法UIActivity .
来自 UIActivity activityDidFinish: 的文档:

Discussion
This method dismisses the sharing interface provided by the UIActivityViewController object. If you provided a view controller using the activityViewController 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 or performActivity 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/

相关文章:

ios - iOS 11 UIBarButtonItem ImageView大小错误

iphone - 录制音频文件并保存在 iPhone 本地

objective-c - Sharekit 未填充 Facebook 文本框

xcode8 - 带有 Cocoa Touch Framework 的 IBInspectable 不起作用? (附代码)

objective-c - 如何在库或框架中禁用 NSLog?例如Admob 库

iOS 8 扩展依赖问题。将一个项目文件导入扩展 View Controller

ios - RKRequestDelegate TotalBytesExpectedToReceive 始终返回 -1

objective-c - iOS 应用程序在单击 UIAlertview 后立即崩溃

iphone - didSelectRowAtIndexPath 没有被调用

ios - 从外部委托(delegate)推送 View Controller