gpt4 book ai didi

objective-c - UIActivityViewController 完成处理程序如何?

转载 作者:太空狗 更新时间:2023-10-30 03:11:18 25 4
gpt4 key购买 nike

我正在尝试使用 UIActivityViewControllerCompletionHandler ,但我不太明白如何......

我想检测用户何时完成或关闭此 View Controller (UIActivityViewController)。

有人知道怎么做吗?

最佳答案

这是显示共享对话框并设置其完成处理程序的方式

NSArray *imageArray = [NSArray arrayWithObject:shareImage];

UIActivityViewController *sharing = [[UIActivityViewController alloc] initWithActivityItems:imageArray applicationActivities:nil];

[sharing setCompletionHandler:^(NSString *activityType, BOOL completed) {
NSLog(@"completed dialog - activity: %@ - finished flag: %d", activityType, completed);
}];

[self presentViewController:sharing animated:YES completion:nil];

关于objective-c - UIActivityViewController 完成处理程序如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12552414/

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