gpt4 book ai didi

ios - 何时以及如何关闭 UIActivityViewController

转载 作者:行者123 更新时间:2023-12-01 16:00:32 34 4
gpt4 key购买 nike

我创建并呈现 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/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com