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