[英]How to get facebook like sliding menu without using third party files in ios?
[英]how to share a link on facebook without using third party library?
我懷疑在Facebook和Twitter上實現共享鏈接。 實際上,我使用sharekit和addThis第三方庫實現了社交共享鏈接,它工作正常,但我希望共享鏈接不使用第三方庫。
在iOS 6中,您可以使用UIActivityViewController
共享指向社交服務的鏈接。
參考: http : //developer.apple.com/library/ios/#documentation/UIKit/Reference/UIActivityViewController_Class/Reference/Reference.html#//apple_ref/occ/cl/UIActivityViewController
這幾行就這么簡單:
NSString *textToShare = @”I just shared this from my App”;
UIImage *imageToShare = [UIImage imageNamed:@"Image.png"];
NSURL *urlToShare = [NSURL URLWithString:@"http://www.mylink.com"];
NSArray *activityItems = @[textToShare, imageToShare, urlToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:TRUE completion:nil];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.