Jon*_*han 1 uiviewcontroller ios
SLServiceTypeFacebook在我关闭视图控制器后,我试图呈现一个视图控制器 ( )。像这样
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
////////////////////////////////////
//Some Stuff Other Calculations//
////////////////////////////////////
//Then
if([SLComposeViewController isAvailableForServiceType: SLServiceTypeFacebook])
{
// Facebook Service Type is Available
SLComposeViewController *slVC = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler handler = ^(SLComposeViewControllerResult result)
{
if (result == SLComposeViewControllerResultCancelled)
{
NSLog(@"Cancelled");
}
else
{
NSLog(@"Done");
}
[slVC dismissViewControllerAnimated:NO completion:Nil];
};
slVC.completionHandler = handler;
[slVC setInitialText:post[@"user_fullname"]];
[slVC addURL:[NSURL URLWithString:post[@"url"]]];
[self presentViewController:slVC animated:NO completion:Nil];
}
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用。Facebook 模式会自动取消。
我在概念上做错了吗?
使用像这样的完成块:
[self dismissViewControllerAnimated:NO completion:^{
//SHOW YOUR NEW VIEW CONTROLLER HERE!
}];
Run Code Online (Sandbox Code Playgroud)
您缺少上面的完成处理程序。
| 归档时间: |
|
| 查看次数: |
4740 次 |
| 最近记录: |