{"action":"created","comment":{"url":"https://api.github.com/repos/marcelofabri/Staged/pulls/comments/73818491","id":73818491,"diff_hunk":"@@ -0,0 +1,81 @@\n+//\n+//  UINavigationController+Staged.m\n+//  Staged\n+//\n+//  Created by Gustavo Barbosa on 7/31/16.\n+//\n+//\n+\n+#import \"UINavigationController+Staged.h\"\n+#import \"UIViewController+StagedSwizziling.h\"\n+\n+NSString * const STGViewControllerWasPushedNotificationName = @\"STGViewControllerWasPushedNotificationName\";\n+NSString * const STGViewControllerWasPoppedNotificationName = @\"STGViewControllerWasPoppedNotificationName\";\n+NSString * const STGNavigationControllerWasPoppedToRootNotificationName = @\"STGNavigationControllerWasPoppedToRootNotificationName\";\n+NSString * const STGNavigationControllerWasPoppedToViewControllerNotificationName = @\"STGNavigationControllerWasPoppedToViewControllerNotificationName\";\n+NSString * const STGNavigationControllerItemsWereSetNotificationName = @\"STGNavigationControllerItemsWereSetNotificationName\";\n+\n+NSString * const STGViewControllerPushingAnimatedKey = @\"STGViewControllerPushingAnimatedKey\";\n+NSString * const STGViewControllerPoppingAnimatedKey = @\"STGViewControllerPoppingAnimatedKey\";\n+\n+@implementation UINavigationController (Staged)\n+\n++ (void)stg_swizzle {\n+    [self stg_replaceInstanceMethod:@selector(pushViewController:animated:)\n+                         withMethod:@selector(stg_pushViewController:animated:)];\n+\n+    [self stg_replaceInstanceMethod:@selector(popViewControllerAnimated:)\n+                         withMethod:@selector(stg_popViewControllerAnimated:)];\n+\n+    [self stg_replaceInstanceMethod:@selector(popToRootViewControllerAnimated:)\n+                         withMethod:@selector(stg_popToRootViewControllerAnimated:)];\n+\n+    [self stg_replaceInstanceMethod:@selector(popToViewController:animated:)\n+                         withMethod:@selector(stg_popToViewController:animated:)];\n+\n+    [self stg_replaceInstanceMethod:@selector(setViewControllers:animated:)\n+                         withMethod:@selector(stg_setViewControllers:animated:)];\n+}\n+\n+- (void)stg_pushViewController:(UIViewController *)viewControllerToPush\n+                      animated:(BOOL)flag {\n+    NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n+    [nc postNotificationName:STGViewControllerWasPushedNotificationName\n+                      object:viewControllerToPush\n+                    userInfo:@{STGViewControllerPushingAnimatedKey: @(flag)}];\n+}\n+\n+- (nullable UIViewController *)stg_popViewControllerAnimated:(BOOL)flag {\n+    NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n+    [nc postNotificationName:STGViewControllerWasPoppedNotificationName\n+                      object:self.topViewController\n+                    userInfo:@{STGViewControllerPoppingAnimatedKey: @(flag)}];\n+    return nil;","path":"Staged/Classes/UINavigationController+Staged.m","position":53,"original_position":53,"commit_id":"72a93e62bab3a7490fdab759c6f43d9fb18b3029","original_commit_id":"72a93e62bab3a7490fdab759c6f43d9fb18b3029","user":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars.githubusercontent.com/u/833072?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"body":"shouldn't these methods return the view controller that would be popped? It's not a big issue since I've never seen any code using the return code, but who knows ¯\\_(ツ)_/¯ ","created_at":"2016-08-08T03:23:11Z","updated_at":"2016-08-08T03:23:11Z","html_url":"https://github.com/marcelofabri/Staged/pull/2#discussion_r73818491","pull_request_url":"https://api.github.com/repos/marcelofabri/Staged/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/comments/73818491"},"html":{"href":"https://github.com/marcelofabri/Staged/pull/2#discussion_r73818491"},"pull_request":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/marcelofabri/Staged/pulls/2","id":79616826,"html_url":"https://github.com/marcelofabri/Staged/pull/2","diff_url":"https://github.com/marcelofabri/Staged/pull/2.diff","patch_url":"https://github.com/marcelofabri/Staged/pull/2.patch","issue_url":"https://api.github.com/repos/marcelofabri/Staged/issues/2","number":2,"state":"open","locked":false,"title":"[WIP] Add support to UINavigationController","user":{"login":"barbosa","id":235208,"avatar_url":"https://avatars.githubusercontent.com/u/235208?v=3","gravatar_id":"","url":"https://api.github.com/users/barbosa","html_url":"https://github.com/barbosa","followers_url":"https://api.github.com/users/barbosa/followers","following_url":"https://api.github.com/users/barbosa/following{/other_user}","gists_url":"https://api.github.com/users/barbosa/gists{/gist_id}","starred_url":"https://api.github.com/users/barbosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbosa/subscriptions","organizations_url":"https://api.github.com/users/barbosa/orgs","repos_url":"https://api.github.com/users/barbosa/repos","events_url":"https://api.github.com/users/barbosa/events{/privacy}","received_events_url":"https://api.github.com/users/barbosa/received_events","type":"User","site_admin":false},"body":"This is still a work in progress. \r\n\r\nIts idea is to have a similar implementation of the verifier for `UINavigationController`s. \r\n\r\nTasks are listed below:\r\n\r\n- [x] create structure with `STGNavigationControllerVerifier` and `UINavigationController` category\r\n- [x] swizzle `pushViewController:animated:`\r\n- [x] swizzle `popViewControllerAnimated:`\r\n- [x] swizzle `popToRootViewControllerAnimated:`\r\n- [x] swizzle `popToViewController:animated:`\r\n- [x] swizzle `setViewControllers:animated:`\r\n- [ ] update documentation","created_at":"2016-08-01T18:51:10Z","updated_at":"2016-08-08T03:23:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"958c41f472dd4de8c6b35dd58e4ae337f0143f59","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/marcelofabri/Staged/pulls/2/commits","review_comments_url":"https://api.github.com/repos/marcelofabri/Staged/pulls/2/comments","review_comment_url":"https://api.github.com/repos/marcelofabri/Staged/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marcelofabri/Staged/issues/2/comments","statuses_url":"https://api.github.com/repos/marcelofabri/Staged/statuses/72a93e62bab3a7490fdab759c6f43d9fb18b3029","head":{"label":"barbosa:feature/navigation-controller","ref":"feature/navigation-controller","sha":"72a93e62bab3a7490fdab759c6f43d9fb18b3029","user":{"login":"barbosa","id":235208,"avatar_url":"https://avatars.githubusercontent.com/u/235208?v=3","gravatar_id":"","url":"https://api.github.com/users/barbosa","html_url":"https://github.com/barbosa","followers_url":"https://api.github.com/users/barbosa/followers","following_url":"https://api.github.com/users/barbosa/following{/other_user}","gists_url":"https://api.github.com/users/barbosa/gists{/gist_id}","starred_url":"https://api.github.com/users/barbosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbosa/subscriptions","organizations_url":"https://api.github.com/users/barbosa/orgs","repos_url":"https://api.github.com/users/barbosa/repos","events_url":"https://api.github.com/users/barbosa/events{/privacy}","received_events_url":"https://api.github.com/users/barbosa/received_events","type":"User","site_admin":false},"repo":{"id":64691894,"name":"Staged","full_name":"barbosa/Staged","owner":{"login":"barbosa","id":235208,"avatar_url":"https://avatars.githubusercontent.com/u/235208?v=3","gravatar_id":"","url":"https://api.github.com/users/barbosa","html_url":"https://github.com/barbosa","followers_url":"https://api.github.com/users/barbosa/followers","following_url":"https://api.github.com/users/barbosa/following{/other_user}","gists_url":"https://api.github.com/users/barbosa/gists{/gist_id}","starred_url":"https://api.github.com/users/barbosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbosa/subscriptions","organizations_url":"https://api.github.com/users/barbosa/orgs","repos_url":"https://api.github.com/users/barbosa/repos","events_url":"https://api.github.com/users/barbosa/events{/privacy}","received_events_url":"https://api.github.com/users/barbosa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/barbosa/Staged","description":"Mock View Controllers presentations and dismissals on unit tests","fork":true,"url":"https://api.github.com/repos/barbosa/Staged","forks_url":"https://api.github.com/repos/barbosa/Staged/forks","keys_url":"https://api.github.com/repos/barbosa/Staged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/barbosa/Staged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/barbosa/Staged/teams","hooks_url":"https://api.github.com/repos/barbosa/Staged/hooks","issue_events_url":"https://api.github.com/repos/barbosa/Staged/issues/events{/number}","events_url":"https://api.github.com/repos/barbosa/Staged/events","assignees_url":"https://api.github.com/repos/barbosa/Staged/assignees{/user}","branches_url":"https://api.github.com/repos/barbosa/Staged/branches{/branch}","tags_url":"https://api.github.com/repos/barbosa/Staged/tags","blobs_url":"https://api.github.com/repos/barbosa/Staged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/barbosa/Staged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/barbosa/Staged/git/refs{/sha}","trees_url":"https://api.github.com/repos/barbosa/Staged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/barbosa/Staged/statuses/{sha}","languages_url":"https://api.github.com/repos/barbosa/Staged/languages","stargazers_url":"https://api.github.com/repos/barbosa/Staged/stargazers","contributors_url":"https://api.github.com/repos/barbosa/Staged/contributors","subscribers_url":"https://api.github.com/repos/barbosa/Staged/subscribers","subscription_url":"https://api.github.com/repos/barbosa/Staged/subscription","commits_url":"https://api.github.com/repos/barbosa/Staged/commits{/sha}","git_commits_url":"https://api.github.com/repos/barbosa/Staged/git/commits{/sha}","comments_url":"https://api.github.com/repos/barbosa/Staged/comments{/number}","issue_comment_url":"https://api.github.com/repos/barbosa/Staged/issues/comments{/number}","contents_url":"https://api.github.com/repos/barbosa/Staged/contents/{+path}","compare_url":"https://api.github.com/repos/barbosa/Staged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/barbosa/Staged/merges","archive_url":"https://api.github.com/repos/barbosa/Staged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/barbosa/Staged/downloads","issues_url":"https://api.github.com/repos/barbosa/Staged/issues{/number}","pulls_url":"https://api.github.com/repos/barbosa/Staged/pulls{/number}","milestones_url":"https://api.github.com/repos/barbosa/Staged/milestones{/number}","notifications_url":"https://api.github.com/repos/barbosa/Staged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/barbosa/Staged/labels{/name}","releases_url":"https://api.github.com/repos/barbosa/Staged/releases{/id}","deployments_url":"https://api.github.com/repos/barbosa/Staged/deployments","created_at":"2016-08-01T18:35:06Z","updated_at":"2016-08-01T18:35:07Z","pushed_at":"2016-08-07T15:49:52Z","git_url":"git://github.com/barbosa/Staged.git","ssh_url":"git@github.com:barbosa/Staged.git","clone_url":"https://github.com/barbosa/Staged.git","svn_url":"https://github.com/barbosa/Staged","homepage":null,"size":138,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marcelofabri:master","ref":"master","sha":"4a300a26c763ed3728a55100ae790b0d0c33c5dc","user":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars.githubusercontent.com/u/833072?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"repo":{"id":60214590,"name":"Staged","full_name":"marcelofabri/Staged","owner":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars.githubusercontent.com/u/833072?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcelofabri/Staged","description":"Mock View Controllers presentations and dismissals on unit tests","fork":false,"url":"https://api.github.com/repos/marcelofabri/Staged","forks_url":"https://api.github.com/repos/marcelofabri/Staged/forks","keys_url":"https://api.github.com/repos/marcelofabri/Staged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcelofabri/Staged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcelofabri/Staged/teams","hooks_url":"https://api.github.com/repos/marcelofabri/Staged/hooks","issue_events_url":"https://api.github.com/repos/marcelofabri/Staged/issues/events{/number}","events_url":"https://api.github.com/repos/marcelofabri/Staged/events","assignees_url":"https://api.github.com/repos/marcelofabri/Staged/assignees{/user}","branches_url":"https://api.github.com/repos/marcelofabri/Staged/branches{/branch}","tags_url":"https://api.github.com/repos/marcelofabri/Staged/tags","blobs_url":"https://api.github.com/repos/marcelofabri/Staged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcelofabri/Staged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcelofabri/Staged/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcelofabri/Staged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcelofabri/Staged/statuses/{sha}","languages_url":"https://api.github.com/repos/marcelofabri/Staged/languages","stargazers_url":"https://api.github.com/repos/marcelofabri/Staged/stargazers","contributors_url":"https://api.github.com/repos/marcelofabri/Staged/contributors","subscribers_url":"https://api.github.com/repos/marcelofabri/Staged/subscribers","subscription_url":"https://api.github.com/repos/marcelofabri/Staged/subscription","commits_url":"https://api.github.com/repos/marcelofabri/Staged/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcelofabri/Staged/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcelofabri/Staged/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcelofabri/Staged/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcelofabri/Staged/contents/{+path}","compare_url":"https://api.github.com/repos/marcelofabri/Staged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcelofabri/Staged/merges","archive_url":"https://api.github.com/repos/marcelofabri/Staged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcelofabri/Staged/downloads","issues_url":"https://api.github.com/repos/marcelofabri/Staged/issues{/number}","pulls_url":"https://api.github.com/repos/marcelofabri/Staged/pulls{/number}","milestones_url":"https://api.github.com/repos/marcelofabri/Staged/milestones{/number}","notifications_url":"https://api.github.com/repos/marcelofabri/Staged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcelofabri/Staged/labels{/name}","releases_url":"https://api.github.com/repos/marcelofabri/Staged/releases{/id}","deployments_url":"https://api.github.com/repos/marcelofabri/Staged/deployments","created_at":"2016-06-01T22:19:44Z","updated_at":"2016-06-13T00:31:52Z","pushed_at":"2016-08-07T15:49:52Z","git_url":"git://github.com/marcelofabri/Staged.git","ssh_url":"git@github.com:marcelofabri/Staged.git","clone_url":"https://github.com/marcelofabri/Staged.git","svn_url":"https://github.com/marcelofabri/Staged","homepage":null,"size":126,"stargazers_count":15,"watchers_count":15,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/2"},"html":{"href":"https://github.com/marcelofabri/Staged/pull/2"},"issue":{"href":"https://api.github.com/repos/marcelofabri/Staged/issues/2"},"comments":{"href":"https://api.github.com/repos/marcelofabri/Staged/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marcelofabri/Staged/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/marcelofabri/Staged/statuses/72a93e62bab3a7490fdab759c6f43d9fb18b3029"}}}}
{"actor":{"display_login":"marcelofabri"}}