{"action":"opened","issue":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/5449","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/5449/labels{/name}","comments_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/5449/comments","events_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/5449/events","html_url":"https://github.com/lionheart/openradar-mirror/issues/5449","id":100868748,"number":5449,"title":"12866303: Proposed new API for extending UIActivity","user":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/classification:enhancement","name":"classification:enhancement","color":"207de5"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/reproducible:not%20applicable","name":"reproducible:not applicable","color":"d4c5f9"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/status:open","name":"status:open","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/89","html_url":"https://github.com/lionheart/openradar-mirror/milestones/iPhone%20SDK","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/89/labels","id":1238708,"number":89,"title":"iPhone SDK","description":null,"creator":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"open_issues":131,"closed_issues":0,"state":"open","created_at":"2015-08-03T16:26:33Z","updated_at":"2015-08-13T21:01:37Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-13T21:01:37Z","updated_at":"2015-08-13T21:01:37Z","closed_at":null,"body":"#### Description\n\nSUMMARY\r\nAs you may well know, extending a UIActivity requires the programmer to override a few methods.\r\n\r\nThe methods that are unequivocally required to be overridden are:\r\n- (NSString *)activityType;\r\n- (NSString *)activityTitle;\r\n- (UIImage *)activityImage;\r\n- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems;\r\n- (void)prepareWithActivityItems:(NSArray *)activityItems;\r\n\r\nThe programmer also has to override one and just one of the following:\r\n- (UIViewController *)activityViewController;\r\n- (void)performActivity;\r\n\r\n\r\nTHE ISSUES\r\nThis API presents some issues regarding how programmers extend a UIActivity:\r\n\r\n1. activityType's only use for the programmer is to be able to exclude it from the UIActivityViewController. This renders useless as the programmer can instead not add it to the applicationActivities.\r\n\r\nIf an id is internally required, it should handled internally and thus transparently to the programmer.\r\n\r\n2. prepareWithActivityItems: just doesn't need to be there. It runs after the user has tapped on the UIActivity and practically immediately after this method is done, the activityViewController or performActivity is called, making it useless to be on a separated method.\r\n\r\nThe activity items should be passed as a parameters to whatever method performs the activity.\r\n\r\n3. Having to choose if the right method to override is activityViewController or performActivity is for ones confusing and for seconds restrictive, since the programmer needs to decide on build time if the activity will be silent or if it will present a UIViewController.\r\n\r\nBoth activityViewController and performActivity should be unified into a single method that will allow the programmer to decide if he wants to show a UIViewController or not while performing the activity.\r\n\r\n\r\nTHE REQUIREMENTS\r\nMain:\r\n* The programmer must be able to decide in run time if he wants to present a UIViewController or run in background, by using a unified method, to perform the activity.\r\n\r\nSecondaries:\r\n* The programmer shouldn't have to override a separate method to prepare the activity items while it could be simple sent as a parameter to the unified perform activity method.\r\n* The programmer shouldn't have to deal with the activityType at all.\r\n\r\n\r\nA PROPOSED SOLUTION\r\nThis project (attached also) is a sample of how much easier it is to extend a UIActivity with this proposed changes, while loosing none of its great functionality.\r\n\r\nhttps://github.com/marianoabdala/ZYActivity\r\n\r\n\r\nSUPPORT\r\nThe project was featured on:\r\nhttp://iosdevweekly.com/issues/71/\r\nhttp://uiactivities.com/post/37633196615/zyactivity-an-easier-to-inherit-uiactivity\r\n\r\nAlso, in 9 days it gathered over 30 stars on GitHub, which I interpret as support or preference over the regular UIActivity API.\r\n\r\n\r\nTHANKS!\r\nFor taking the time to read through this and for being open to suggestions.\n\n-\nProduct Version: 6.0\nCreated: 2012-12-12T18:27:44.434596\nOriginated: 2012-12-12T00:00:00\nOpen Radar Link: http://www.openradar.me/12866303"}}