1
據我所知,UIActivity View Controller有一個Facebook & Twitter按鈕,但如果有服務通過UIActivityViewController共享到Google+或LinkedIn,我就會徘徊?LinkedIn和Google+ UIActivity View Controller按鈕?
據我所知,UIActivity View Controller有一個Facebook & Twitter按鈕,但如果有服務通過UIActivityViewController共享到Google+或LinkedIn,我就會徘徊?LinkedIn和Google+ UIActivity View Controller按鈕?
蘋果提供的類型中沒有一種可用,但您可以創建自己的。您可以創建一個UIActivity
類,並把它傳遞到UIActivityViewController
來處理髮送數據給每個你正在尋找的互動與服務:
DataItemProvider *dataToShare = [[DataItemProvider alloc] initWithPlaceholderItem:FileTypeToShare];
GooglePlusActivityType *googleActivity = [[GooglePlusActivityType alloc] init];
LinkdInActivityType *linkdinActivity = [[LinkdInActivityType alloc] init];
NSArray *activityTypes = @[googleActivity, linkdinActivity];
NSArray *activityItems = @[dataToShare];
UIActivityViewController *activityController = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:activityTypes];
[activityController setCompletionHandler:^(NSString *activityType, BOOL completed) {
//Put in your completion handle code here.
}];
[self presentViewController:activityController animated:YES completion:nil];
然後實現類都GooglePlusActivityType
和LinkdInActivityType
處理加載數據到兩個網站。
您必須創建自己的應用程序特定'UIActivity'類,以實現與Google+,LinkedIn或任何其他您需要的服務的集成,這些服務不是由'UIKit'提供的。 – rmaddy 2013-03-24 16:24:44