ios SLComposeViewController共享教程




1 Answers

只需使用此代码在Facebook上分享。

SLComposeViewController *controllerSLC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controllerSLC setInitialText:@"First post from my iPhone app"];
[controllerSLC addURL:[NSURL URLWithString:@"http://www.appcoda.com"]];
[controllerSLC addImage:[UIImage imageNamed:@"test.jpg"]];
[self presentViewController:controllerSLC animated:YES completion:Nil];

如果你想要这个Twitter的话,只需更改SLServiceTypeTwitter。

ios ios6 slcomposeviewcontroller social-framework

我需要遵循什么步骤才能使用iOS 6的新SLComposeViewController发布到Facebook,Twitter或新浪微博?




Related