{"action":"created","comment":{"url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/comments/28054451","id":28054451,"diff_hunk":"@@ -0,0 +1,151 @@\n+//\n+//  LettersViewController.m\n+//  Navigation\n+//\n+//  Created by Lidia Chou on 3/16/15.\n+//  Copyright (c) 2015 Vinicius Miana. All rights reserved.\n+//\n+\n+#import \"LettersViewController.h\"\n+#import \"Letters.h\"\n+#import \"Alphabet.h\"\n+\n+@interface LettersViewController () {\n+    Alphabet *alphabet;\n+}\n+\n+@end\n+\n+@implementation LettersViewController {\n+    NSMutableArray *todasLetras;\n+    NSMutableArray *arrayAlph;\n+    Letters *letraAtual;\n+}\n+\n+//Declara fora do DidLoad pq quando chama a view, não reinicializa como 0\n+int indexAlphabet = 0;\n+\n+@synthesize letterLabel, wordLabel, wordImage;\n+\n+\n+- (void)viewDidLoad {\n+    [super viewDidLoad];\n+    \n+    self.view.backgroundColor = [UIColor whiteColor];\n+    \n+    alphabet = [Alphabet sharedInstance];\n+    todasLetras = [alphabet getAlphabet];\n+\n+    arrayAlph = [[NSMutableArray alloc] initWithArray:self.navigationController.viewControllers];\n+    \n+    //inicializando e ajustando a letra na tela\n+    letterLabel = [[UILabel alloc] init];\n+    letterLabel.textAlignment = NSTextAlignmentCenter;\n+    letterLabel.backgroundColor = [UIColor blueColor];\n+    letterLabel.textColor = [UIColor whiteColor];\n+    letterLabel.frame = CGRectMake(self.view.bounds.size.width/2 - 25, 100, 50, 50);\n+    \n+    //inicializando e ajustando a palavra na tela\n+    wordLabel = [[UILabel alloc] init];\n+    wordLabel.textAlignment = NSTextAlignmentCenter;\n+    wordLabel.frame = CGRectMake(self.view.bounds.size.width/2 - 100, 160, 200, 30);\n+    \n+    //inicializando e ajustando a imagem na tela\n+    wordImage = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/2 - 100, 230, 200, 200)];\n+    wordImage.backgroundColor = [UIColor whiteColor];\n+    \n+    //adicionando as Labels e a imagem\n+    [self.view addSubview:letterLabel];\n+    [self.view addSubview:wordLabel];\n+    [self.view addSubview:wordImage];\n+    \n+}\n+\n+-(void)viewWillAppear:(BOOL)animated{\n+    \n+    letraAtual = [todasLetras objectAtIndex:indexAlphabet];\n+    \n+    [self.letterLabel setText:letraAtual.letter];\n+    [self.wordLabel setText:letraAtual.word];\n+    [self.wordImage setImage:[UIImage imageNamed:letraAtual.image]];\n+    \n+    //adicionando animação a cada mudança de letra\n+    CATransition *mudaTela = [CATransition animation];\n+    mudaTela.duration = 1;\n+    mudaTela.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn];\n+    mudaTela.delegate = self;\n+    [self.navigationController.view.layer addAnimation:mudaTela forKey:nil];\n+    \n+    \n+    NSLog(@\"index: %i\", indexAlphabet);\n+    NSLog(@\"letra: %@\", letterLabel.text);\n+    NSLog(@\"palavra: %@\", wordLabel.text);\n+    \n+    self.title = letterLabel.text;\n+    \n+    \n+    UIBarButtonItem *next = [[UIBarButtonItem alloc]\n+                             initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:self action:@selector(next:)];\n+    self.navigationItem.rightBarButtonItem = next;\n+    \n+    UIBarButtonItem *back = [[UIBarButtonItem alloc]\n+                             initWithBarButtonSystemItem:UIBarButtonSystemItemRewind target:self action:@selector(back:)];\n+    self.navigationItem.leftBarButtonItem = back;\n+\n+    UIButton *botao = [UIButton buttonWithType:UIButtonTypeSystem];\n+    [botao setTitle:wordLabel.text forState:UIControlStateNormal];\n+    [botao sizeToFit];\n+    [self.view addSubview:botao];\n+    \n+}\n+\n+- (void)didReceiveMemoryWarning {\n+    [super didReceiveMemoryWarning];\n+    // Dispose of any resources that can be recreated.\n+}\n+\n+-(void)next:(id)sender {\n+        if (indexAlphabet == 25) {\n+            [self.navigationController popToRootViewControllerAnimated:YES];\n+            indexAlphabet = 0;\n+            \n+        } else {\n+            indexAlphabet ++;\n+            LettersViewController *proximo = [[LettersViewController alloc]\n+                                              initWithNibName:nil\n+                                              bundle:NULL];\n+            [self.navigationController pushViewController:proximo\n+                                                 animated:YES];\n+            \n+            //tira a instancia anterior da pilha\n+            [self.navigationController popViewControllerAnimated:NO];","path":"Navigation/Navigation/LettersViewController.m","position":121,"original_position":121,"commit_id":"eb75a7d0f12ef3487a6b93522eb11e87916509f6","original_commit_id":"eb75a7d0f12ef3487a6b93522eb11e87916509f6","user":{"login":"Lihh","id":6583964,"avatar_url":"https://avatars.githubusercontent.com/u/6583964?v=3","gravatar_id":"","url":"https://api.github.com/users/Lihh","html_url":"https://github.com/Lihh","followers_url":"https://api.github.com/users/Lihh/followers","following_url":"https://api.github.com/users/Lihh/following{/other_user}","gists_url":"https://api.github.com/users/Lihh/gists{/gist_id}","starred_url":"https://api.github.com/users/Lihh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lihh/subscriptions","organizations_url":"https://api.github.com/users/Lihh/orgs","repos_url":"https://api.github.com/users/Lihh/repos","events_url":"https://api.github.com/users/Lihh/events{/privacy}","received_events_url":"https://api.github.com/users/Lihh/received_events","type":"User","site_admin":false},"body":"Então, pelo que eu tinha entendido:\r\nNa atual view controller eu dou um push e um pop. Como esse método é feito na própria view controller que eu quero desempilhar, então dá certo. Eu não acesso a view anterior em momento nenhum. O que eu fiz foi desempilhar a view atual logo antes de chamar a próxima view haha","created_at":"2015-04-09T11:38:46Z","updated_at":"2015-04-09T11:38:46Z","html_url":"https://github.com/mackmobile/iDicionario/pull/12#discussion_r28054451","pull_request_url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/comments/28054451"},"html":{"href":"https://github.com/mackmobile/iDicionario/pull/12#discussion_r28054451"},"pull_request":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12","id":31252357,"html_url":"https://github.com/mackmobile/iDicionario/pull/12","diff_url":"https://github.com/mackmobile/iDicionario/pull/12.diff","patch_url":"https://github.com/mackmobile/iDicionario/pull/12.patch","issue_url":"https://api.github.com/repos/mackmobile/iDicionario/issues/12","number":12,"state":"open","locked":false,"title":"Lidia Chou","user":{"login":"Lihh","id":6583964,"avatar_url":"https://avatars.githubusercontent.com/u/6583964?v=3","gravatar_id":"","url":"https://api.github.com/users/Lihh","html_url":"https://github.com/Lihh","followers_url":"https://api.github.com/users/Lihh/followers","following_url":"https://api.github.com/users/Lihh/following{/other_user}","gists_url":"https://api.github.com/users/Lihh/gists{/gist_id}","starred_url":"https://api.github.com/users/Lihh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lihh/subscriptions","organizations_url":"https://api.github.com/users/Lihh/orgs","repos_url":"https://api.github.com/users/Lihh/repos","events_url":"https://api.github.com/users/Lihh/events{/privacy}","received_events_url":"https://api.github.com/users/Lihh/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-16T15:15:49Z","updated_at":"2015-04-09T11:38:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9aa500f69d81b5259de0419631c23dad7cb0ac24","assignee":{"login":"gabrielAlbertoJesusPreto","id":10827794,"avatar_url":"https://avatars.githubusercontent.com/u/10827794?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielAlbertoJesusPreto","html_url":"https://github.com/gabrielAlbertoJesusPreto","followers_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/followers","following_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/following{/other_user}","gists_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/subscriptions","organizations_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/orgs","repos_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/repos","events_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielAlbertoJesusPreto/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mackmobile/iDicionario/milestones/1","html_url":"https://github.com/mackmobile/iDicionario/milestones/2015@manha","labels_url":"https://api.github.com/repos/mackmobile/iDicionario/milestones/1/labels","id":1028910,"number":1,"title":"2015@manha","description":"","creator":{"login":"ViniciusMiana","id":2053546,"avatar_url":"https://avatars.githubusercontent.com/u/2053546?v=3","gravatar_id":"","url":"https://api.github.com/users/ViniciusMiana","html_url":"https://github.com/ViniciusMiana","followers_url":"https://api.github.com/users/ViniciusMiana/followers","following_url":"https://api.github.com/users/ViniciusMiana/following{/other_user}","gists_url":"https://api.github.com/users/ViniciusMiana/gists{/gist_id}","starred_url":"https://api.github.com/users/ViniciusMiana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViniciusMiana/subscriptions","organizations_url":"https://api.github.com/users/ViniciusMiana/orgs","repos_url":"https://api.github.com/users/ViniciusMiana/repos","events_url":"https://api.github.com/users/ViniciusMiana/events{/privacy}","received_events_url":"https://api.github.com/users/ViniciusMiana/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":0,"state":"open","created_at":"2015-03-19T10:40:46Z","updated_at":"2015-03-19T18:32:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12/commits","review_comments_url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12/comments","review_comment_url":"https://api.github.com/repos/mackmobile/iDicionario/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mackmobile/iDicionario/issues/12/comments","statuses_url":"https://api.github.com/repos/mackmobile/iDicionario/statuses/eb75a7d0f12ef3487a6b93522eb11e87916509f6","head":{"label":"Lihh:master","ref":"master","sha":"eb75a7d0f12ef3487a6b93522eb11e87916509f6","user":{"login":"Lihh","id":6583964,"avatar_url":"https://avatars.githubusercontent.com/u/6583964?v=3","gravatar_id":"","url":"https://api.github.com/users/Lihh","html_url":"https://github.com/Lihh","followers_url":"https://api.github.com/users/Lihh/followers","following_url":"https://api.github.com/users/Lihh/following{/other_user}","gists_url":"https://api.github.com/users/Lihh/gists{/gist_id}","starred_url":"https://api.github.com/users/Lihh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lihh/subscriptions","organizations_url":"https://api.github.com/users/Lihh/orgs","repos_url":"https://api.github.com/users/Lihh/repos","events_url":"https://api.github.com/users/Lihh/events{/privacy}","received_events_url":"https://api.github.com/users/Lihh/received_events","type":"User","site_admin":false},"repo":{"id":32322348,"name":"iDicionario","full_name":"Lihh/iDicionario","owner":{"login":"Lihh","id":6583964,"avatar_url":"https://avatars.githubusercontent.com/u/6583964?v=3","gravatar_id":"","url":"https://api.github.com/users/Lihh","html_url":"https://github.com/Lihh","followers_url":"https://api.github.com/users/Lihh/followers","following_url":"https://api.github.com/users/Lihh/following{/other_user}","gists_url":"https://api.github.com/users/Lihh/gists{/gist_id}","starred_url":"https://api.github.com/users/Lihh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lihh/subscriptions","organizations_url":"https://api.github.com/users/Lihh/orgs","repos_url":"https://api.github.com/users/Lihh/repos","events_url":"https://api.github.com/users/Lihh/events{/privacy}","received_events_url":"https://api.github.com/users/Lihh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lihh/iDicionario","description":"Dicionario Infantil","fork":true,"url":"https://api.github.com/repos/Lihh/iDicionario","forks_url":"https://api.github.com/repos/Lihh/iDicionario/forks","keys_url":"https://api.github.com/repos/Lihh/iDicionario/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lihh/iDicionario/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lihh/iDicionario/teams","hooks_url":"https://api.github.com/repos/Lihh/iDicionario/hooks","issue_events_url":"https://api.github.com/repos/Lihh/iDicionario/issues/events{/number}","events_url":"https://api.github.com/repos/Lihh/iDicionario/events","assignees_url":"https://api.github.com/repos/Lihh/iDicionario/assignees{/user}","branches_url":"https://api.github.com/repos/Lihh/iDicionario/branches{/branch}","tags_url":"https://api.github.com/repos/Lihh/iDicionario/tags","blobs_url":"https://api.github.com/repos/Lihh/iDicionario/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lihh/iDicionario/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lihh/iDicionario/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lihh/iDicionario/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lihh/iDicionario/statuses/{sha}","languages_url":"https://api.github.com/repos/Lihh/iDicionario/languages","stargazers_url":"https://api.github.com/repos/Lihh/iDicionario/stargazers","contributors_url":"https://api.github.com/repos/Lihh/iDicionario/contributors","subscribers_url":"https://api.github.com/repos/Lihh/iDicionario/subscribers","subscription_url":"https://api.github.com/repos/Lihh/iDicionario/subscription","commits_url":"https://api.github.com/repos/Lihh/iDicionario/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lihh/iDicionario/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lihh/iDicionario/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lihh/iDicionario/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lihh/iDicionario/contents/{+path}","compare_url":"https://api.github.com/repos/Lihh/iDicionario/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lihh/iDicionario/merges","archive_url":"https://api.github.com/repos/Lihh/iDicionario/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lihh/iDicionario/downloads","issues_url":"https://api.github.com/repos/Lihh/iDicionario/issues{/number}","pulls_url":"https://api.github.com/repos/Lihh/iDicionario/pulls{/number}","milestones_url":"https://api.github.com/repos/Lihh/iDicionario/milestones{/number}","notifications_url":"https://api.github.com/repos/Lihh/iDicionario/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lihh/iDicionario/labels{/name}","releases_url":"https://api.github.com/repos/Lihh/iDicionario/releases{/id}","created_at":"2015-03-16T12:07:54Z","updated_at":"2015-03-20T14:24:49Z","pushed_at":"2015-03-20T14:24:49Z","git_url":"git://github.com/Lihh/iDicionario.git","ssh_url":"git@github.com:Lihh/iDicionario.git","clone_url":"https://github.com/Lihh/iDicionario.git","svn_url":"https://github.com/Lihh/iDicionario","homepage":null,"size":6002,"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":"mackmobile:master","ref":"master","sha":"af94acbdecb7d3afab6fec7d3e6c2ebda3e9c99f","user":{"login":"mackmobile","id":8823168,"avatar_url":"https://avatars.githubusercontent.com/u/8823168?v=3","gravatar_id":"","url":"https://api.github.com/users/mackmobile","html_url":"https://github.com/mackmobile","followers_url":"https://api.github.com/users/mackmobile/followers","following_url":"https://api.github.com/users/mackmobile/following{/other_user}","gists_url":"https://api.github.com/users/mackmobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mackmobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackmobile/subscriptions","organizations_url":"https://api.github.com/users/mackmobile/orgs","repos_url":"https://api.github.com/users/mackmobile/repos","events_url":"https://api.github.com/users/mackmobile/events{/privacy}","received_events_url":"https://api.github.com/users/mackmobile/received_events","type":"Organization","site_admin":false},"repo":{"id":32293320,"name":"iDicionario","full_name":"mackmobile/iDicionario","owner":{"login":"mackmobile","id":8823168,"avatar_url":"https://avatars.githubusercontent.com/u/8823168?v=3","gravatar_id":"","url":"https://api.github.com/users/mackmobile","html_url":"https://github.com/mackmobile","followers_url":"https://api.github.com/users/mackmobile/followers","following_url":"https://api.github.com/users/mackmobile/following{/other_user}","gists_url":"https://api.github.com/users/mackmobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mackmobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackmobile/subscriptions","organizations_url":"https://api.github.com/users/mackmobile/orgs","repos_url":"https://api.github.com/users/mackmobile/repos","events_url":"https://api.github.com/users/mackmobile/events{/privacy}","received_events_url":"https://api.github.com/users/mackmobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mackmobile/iDicionario","description":"Dicionario Infantil","fork":false,"url":"https://api.github.com/repos/mackmobile/iDicionario","forks_url":"https://api.github.com/repos/mackmobile/iDicionario/forks","keys_url":"https://api.github.com/repos/mackmobile/iDicionario/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mackmobile/iDicionario/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mackmobile/iDicionario/teams","hooks_url":"https://api.github.com/repos/mackmobile/iDicionario/hooks","issue_events_url":"https://api.github.com/repos/mackmobile/iDicionario/issues/events{/number}","events_url":"https://api.github.com/repos/mackmobile/iDicionario/events","assignees_url":"https://api.github.com/repos/mackmobile/iDicionario/assignees{/user}","branches_url":"https://api.github.com/repos/mackmobile/iDicionario/branches{/branch}","tags_url":"https://api.github.com/repos/mackmobile/iDicionario/tags","blobs_url":"https://api.github.com/repos/mackmobile/iDicionario/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mackmobile/iDicionario/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mackmobile/iDicionario/git/refs{/sha}","trees_url":"https://api.github.com/repos/mackmobile/iDicionario/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mackmobile/iDicionario/statuses/{sha}","languages_url":"https://api.github.com/repos/mackmobile/iDicionario/languages","stargazers_url":"https://api.github.com/repos/mackmobile/iDicionario/stargazers","contributors_url":"https://api.github.com/repos/mackmobile/iDicionario/contributors","subscribers_url":"https://api.github.com/repos/mackmobile/iDicionario/subscribers","subscription_url":"https://api.github.com/repos/mackmobile/iDicionario/subscription","commits_url":"https://api.github.com/repos/mackmobile/iDicionario/commits{/sha}","git_commits_url":"https://api.github.com/repos/mackmobile/iDicionario/git/commits{/sha}","comments_url":"https://api.github.com/repos/mackmobile/iDicionario/comments{/number}","issue_comment_url":"https://api.github.com/repos/mackmobile/iDicionario/issues/comments{/number}","contents_url":"https://api.github.com/repos/mackmobile/iDicionario/contents/{+path}","compare_url":"https://api.github.com/repos/mackmobile/iDicionario/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mackmobile/iDicionario/merges","archive_url":"https://api.github.com/repos/mackmobile/iDicionario/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mackmobile/iDicionario/downloads","issues_url":"https://api.github.com/repos/mackmobile/iDicionario/issues{/number}","pulls_url":"https://api.github.com/repos/mackmobile/iDicionario/pulls{/number}","milestones_url":"https://api.github.com/repos/mackmobile/iDicionario/milestones{/number}","notifications_url":"https://api.github.com/repos/mackmobile/iDicionario/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mackmobile/iDicionario/labels{/name}","releases_url":"https://api.github.com/repos/mackmobile/iDicionario/releases{/id}","created_at":"2015-03-16T01:08:32Z","updated_at":"2015-04-08T19:42:49Z","pushed_at":"2015-04-08T19:55:49Z","git_url":"git://github.com/mackmobile/iDicionario.git","ssh_url":"git@github.com:mackmobile/iDicionario.git","clone_url":"https://github.com/mackmobile/iDicionario.git","svn_url":"https://github.com/mackmobile/iDicionario","homepage":null,"size":292815,"stargazers_count":1,"watchers_count":1,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":50,"forks":50,"open_issues":50,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12"},"html":{"href":"https://github.com/mackmobile/iDicionario/pull/12"},"issue":{"href":"https://api.github.com/repos/mackmobile/iDicionario/issues/12"},"comments":{"href":"https://api.github.com/repos/mackmobile/iDicionario/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mackmobile/iDicionario/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/mackmobile/iDicionario/statuses/eb75a7d0f12ef3487a6b93522eb11e87916509f6"}}}}