Надеюсь, все знают, что iOS 6 содержит новый стиль ActionSheet (UIActivityViewController).
. UIActivityViewController
можно инициировать с такими параметрами, как строка, URL-адрес, изображение и т. д. Ниже приведен фрагмент кода для этого (где элементы представляют собой массив со строкой и параметрами URL-адреса).
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
Но есть ли способ, которым мы можем назначать разные параметры, когда мы выбираем разные варианты обмена, такие как Mail, Facebook или Twitter?
Один из методов заключается в том, что мы можем реализовать UIActivityItemSource, где нам нужно реализовать исходные методы.
- (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType
который всегда возвращает строковое значение. Но мне нужно передать массив, чтобы я мог назначать различные параметры, такие как URL, изображение и заголовок.
Любая идея, как мы можем достичь этого?