关于"SLComposeViewController";在iOS 11 Beta中 [英] About "SLComposeViewController" in iOS 11 beta
本文介绍了关于"SLComposeViewController";在iOS 11 Beta中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目中,我始终使用SLComposeViewController
与第三方应用程序共享内容,但是现在,当我将iPhone更新到iOS 11 beta时,此功能不再起作用.
In my project, I always use SLComposeViewController
to share contents with third-party apps, but now, when I update my iPhone to iOS 11 beta, this no longer works.
SLComposeViewControllerCompletionHandler
始终回调SLComposeViewControllerResultCancelled
.
这是为什么?
推荐答案
我在iOS 11中遇到关于SLComposer的问题.但是我只是删除了检查行,显然,自己的SDK在内部对我进行了验证.
I was having problems with regard to the SLComposer in iOS 11. But I just removed the line that checks and apparently the own SDK makes the validacoes to me internally.
删除此行可用于任何SLServiceType
:
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
因此,发展您的逻辑.就我而言:
So, develop your logic. In my case:
SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[mySLComposerSheet setInitialText:@"#myInitialTextIsHere"];
[mySLComposerSheet addURL:[NSURL URLWithString:strURL]];
[mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
switch (result) {
case SLComposeViewControllerResultCancelled:
NSLog(@"Post Canceled");
break;
case SLComposeViewControllerResultDone:
NSLog(@"Post Sucessful");
break;
default:
break;
}
}];
[self presentViewController:mySLComposerSheet animated:YES completion:nil];
我希望我有所帮助!
这篇关于关于"SLComposeViewController";在iOS 11 Beta中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文