Hope everyone knows that iOS 6 contains a new style of ActionSheet (UIActivityViewController). . UIActivityViewController can be triggered with paramaxes like string, url, image, etc. Below is a snippet of code for this (where items is an array with a string and url params).
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
But is there a way we can assign different parameters when we select different exchange options, such as Mail, Facebook or Twitter?
One way - we can implement UIActivityItemSource, where we need to implement the original methods
- (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType
which always returns a string value. But I need to pass an array so that I can assign various parameters such as URL, image and title.
Any idea how we can achieve this?
ashok source share