{"action":"created","comment":{"url":"https://api.github.com/repos/aducret/Training/pulls/comments/27572936","id":27572936,"diff_hunk":"@@ -0,0 +1,27 @@\n+//\n+//  RegexValidations.m\n+//  Training\n+//\n+//  Created by Argentino Ducret on 3/30/15.\n+//  Copyright (c) 2015 Wolox. All rights reserved.\n+//\n+\n+#import \"RegexValidations.h\"\n+\n+@implementation RegexValidations\n+\n++ (BOOL) validateEmail: (NSString *) candidate {\n+    NSString *emailRegex =\n+    @\"(?:[a-z0-9!#$%\\\\&'*+/=?\\\\^_`{|}~-]+(?:\\\\.[a-z0-9!#$%\\\\&'*+/=?\\\\^_`{|}\"\n+    @\"~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\\"\n+    @\"x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-\"\n+    @\"z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5\"\n+    @\"]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-\"\n+    @\"9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\"\n+    @\"-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n+    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@\"SELF MATCHES[c] %@\", emailRegex];","path":"Training/Helpers/RegexValidations.m","position":22,"original_position":22,"commit_id":"a2034427565dbff39ddaad1603be4dde95ce8b09","original_commit_id":"a2034427565dbff39ddaad1603be4dde95ce8b09","user":{"login":"guidomb","id":390645,"avatar_url":"https://avatars.githubusercontent.com/u/390645?v=3","gravatar_id":"","url":"https://api.github.com/users/guidomb","html_url":"https://github.com/guidomb","followers_url":"https://api.github.com/users/guidomb/followers","following_url":"https://api.github.com/users/guidomb/following{/other_user}","gists_url":"https://api.github.com/users/guidomb/gists{/gist_id}","starred_url":"https://api.github.com/users/guidomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guidomb/subscriptions","organizations_url":"https://api.github.com/users/guidomb/orgs","repos_url":"https://api.github.com/users/guidomb/repos","events_url":"https://api.github.com/users/guidomb/events{/privacy}","received_events_url":"https://api.github.com/users/guidomb/received_events","type":"User","site_admin":false},"body":"declarar esto como una variable de clase para evitar compilar la expresión regular cada vez que se ejecuta el método. Para esto declarar una variable antes del `@implementation` de la siguiente forma:\r\n\r\n```objc\r\nstatic NSString * const = @\"......\";\r\nstatic NSPredicate * EmailTest;\r\n```\r\n\r\nluego inicializar el predicate en el class initializer (que esta garantizado de ser thread safe y ejecutarse una sola vez)\r\n\r\n```objc\r\n+ (void)initialize {\r\n  EmailTest = [NSPredicate predicateWithFormat:@\"SELF MATCHES[c] %@\", emailRegex];\r\n}\r\n```","created_at":"2015-04-01T14:22:30Z","updated_at":"2015-04-01T14:22:30Z","html_url":"https://github.com/aducret/Training/pull/1#discussion_r27572936","pull_request_url":"https://api.github.com/repos/aducret/Training/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/aducret/Training/pulls/comments/27572936"},"html":{"href":"https://github.com/aducret/Training/pull/1#discussion_r27572936"},"pull_request":{"href":"https://api.github.com/repos/aducret/Training/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/aducret/Training/pulls/1","id":32244133,"html_url":"https://github.com/aducret/Training/pull/1","diff_url":"https://github.com/aducret/Training/pull/1.diff","patch_url":"https://github.com/aducret/Training/pull/1.patch","issue_url":"https://api.github.com/repos/aducret/Training/issues/1","number":1,"state":"open","locked":false,"title":"Login signup","user":{"login":"aducret","id":1799612,"avatar_url":"https://avatars.githubusercontent.com/u/1799612?v=3","gravatar_id":"","url":"https://api.github.com/users/aducret","html_url":"https://github.com/aducret","followers_url":"https://api.github.com/users/aducret/followers","following_url":"https://api.github.com/users/aducret/following{/other_user}","gists_url":"https://api.github.com/users/aducret/gists{/gist_id}","starred_url":"https://api.github.com/users/aducret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aducret/subscriptions","organizations_url":"https://api.github.com/users/aducret/orgs","repos_url":"https://api.github.com/users/aducret/repos","events_url":"https://api.github.com/users/aducret/events{/privacy}","received_events_url":"https://api.github.com/users/aducret/received_events","type":"User","site_admin":false},"body":"Se puede hacer login y sign up. Todas las notificaciones se muestran en un toast. \r\nEstoy teniendo problemas al rotar la pantalla. \r\n\r\nLinks a trello: \r\nhttps://trello.com/c/gWxBTYev/14-login\r\nhttps://trello.com/c/al7DllmZ/21-tech-login\r\nhttps://trello.com/c/ptaX0jud/15-signup\r\nhttps://trello.com/c/G0eUjbXY/22-tech-signup","created_at":"2015-03-30T16:39:31Z","updated_at":"2015-04-01T14:22:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b4fe5eefd4f0f8c76412ec2ecb69b297cfd4b49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aducret/Training/pulls/1/commits","review_comments_url":"https://api.github.com/repos/aducret/Training/pulls/1/comments","review_comment_url":"https://api.github.com/repos/aducret/Training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aducret/Training/issues/1/comments","statuses_url":"https://api.github.com/repos/aducret/Training/statuses/a2034427565dbff39ddaad1603be4dde95ce8b09","head":{"label":"aducret:loginSignup","ref":"loginSignup","sha":"a2034427565dbff39ddaad1603be4dde95ce8b09","user":{"login":"aducret","id":1799612,"avatar_url":"https://avatars.githubusercontent.com/u/1799612?v=3","gravatar_id":"","url":"https://api.github.com/users/aducret","html_url":"https://github.com/aducret","followers_url":"https://api.github.com/users/aducret/followers","following_url":"https://api.github.com/users/aducret/following{/other_user}","gists_url":"https://api.github.com/users/aducret/gists{/gist_id}","starred_url":"https://api.github.com/users/aducret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aducret/subscriptions","organizations_url":"https://api.github.com/users/aducret/orgs","repos_url":"https://api.github.com/users/aducret/repos","events_url":"https://api.github.com/users/aducret/events{/privacy}","received_events_url":"https://api.github.com/users/aducret/received_events","type":"User","site_admin":false},"repo":{"id":32886194,"name":"Training","full_name":"aducret/Training","owner":{"login":"aducret","id":1799612,"avatar_url":"https://avatars.githubusercontent.com/u/1799612?v=3","gravatar_id":"","url":"https://api.github.com/users/aducret","html_url":"https://github.com/aducret","followers_url":"https://api.github.com/users/aducret/followers","following_url":"https://api.github.com/users/aducret/following{/other_user}","gists_url":"https://api.github.com/users/aducret/gists{/gist_id}","starred_url":"https://api.github.com/users/aducret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aducret/subscriptions","organizations_url":"https://api.github.com/users/aducret/orgs","repos_url":"https://api.github.com/users/aducret/repos","events_url":"https://api.github.com/users/aducret/events{/privacy}","received_events_url":"https://api.github.com/users/aducret/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aducret/Training","description":"","fork":false,"url":"https://api.github.com/repos/aducret/Training","forks_url":"https://api.github.com/repos/aducret/Training/forks","keys_url":"https://api.github.com/repos/aducret/Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aducret/Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aducret/Training/teams","hooks_url":"https://api.github.com/repos/aducret/Training/hooks","issue_events_url":"https://api.github.com/repos/aducret/Training/issues/events{/number}","events_url":"https://api.github.com/repos/aducret/Training/events","assignees_url":"https://api.github.com/repos/aducret/Training/assignees{/user}","branches_url":"https://api.github.com/repos/aducret/Training/branches{/branch}","tags_url":"https://api.github.com/repos/aducret/Training/tags","blobs_url":"https://api.github.com/repos/aducret/Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aducret/Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aducret/Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/aducret/Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aducret/Training/statuses/{sha}","languages_url":"https://api.github.com/repos/aducret/Training/languages","stargazers_url":"https://api.github.com/repos/aducret/Training/stargazers","contributors_url":"https://api.github.com/repos/aducret/Training/contributors","subscribers_url":"https://api.github.com/repos/aducret/Training/subscribers","subscription_url":"https://api.github.com/repos/aducret/Training/subscription","commits_url":"https://api.github.com/repos/aducret/Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/aducret/Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/aducret/Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/aducret/Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/aducret/Training/contents/{+path}","compare_url":"https://api.github.com/repos/aducret/Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aducret/Training/merges","archive_url":"https://api.github.com/repos/aducret/Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aducret/Training/downloads","issues_url":"https://api.github.com/repos/aducret/Training/issues{/number}","pulls_url":"https://api.github.com/repos/aducret/Training/pulls{/number}","milestones_url":"https://api.github.com/repos/aducret/Training/milestones{/number}","notifications_url":"https://api.github.com/repos/aducret/Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aducret/Training/labels{/name}","releases_url":"https://api.github.com/repos/aducret/Training/releases{/id}","created_at":"2015-03-25T19:28:50Z","updated_at":"2015-03-25T19:40:18Z","pushed_at":"2015-03-30T16:39:31Z","git_url":"git://github.com/aducret/Training.git","ssh_url":"git@github.com:aducret/Training.git","clone_url":"https://github.com/aducret/Training.git","svn_url":"https://github.com/aducret/Training","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"aducret:master","ref":"master","sha":"96c2620b15b407241091bc6cae6451ee054d58da","user":{"login":"aducret","id":1799612,"avatar_url":"https://avatars.githubusercontent.com/u/1799612?v=3","gravatar_id":"","url":"https://api.github.com/users/aducret","html_url":"https://github.com/aducret","followers_url":"https://api.github.com/users/aducret/followers","following_url":"https://api.github.com/users/aducret/following{/other_user}","gists_url":"https://api.github.com/users/aducret/gists{/gist_id}","starred_url":"https://api.github.com/users/aducret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aducret/subscriptions","organizations_url":"https://api.github.com/users/aducret/orgs","repos_url":"https://api.github.com/users/aducret/repos","events_url":"https://api.github.com/users/aducret/events{/privacy}","received_events_url":"https://api.github.com/users/aducret/received_events","type":"User","site_admin":false},"repo":{"id":32886194,"name":"Training","full_name":"aducret/Training","owner":{"login":"aducret","id":1799612,"avatar_url":"https://avatars.githubusercontent.com/u/1799612?v=3","gravatar_id":"","url":"https://api.github.com/users/aducret","html_url":"https://github.com/aducret","followers_url":"https://api.github.com/users/aducret/followers","following_url":"https://api.github.com/users/aducret/following{/other_user}","gists_url":"https://api.github.com/users/aducret/gists{/gist_id}","starred_url":"https://api.github.com/users/aducret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aducret/subscriptions","organizations_url":"https://api.github.com/users/aducret/orgs","repos_url":"https://api.github.com/users/aducret/repos","events_url":"https://api.github.com/users/aducret/events{/privacy}","received_events_url":"https://api.github.com/users/aducret/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aducret/Training","description":"","fork":false,"url":"https://api.github.com/repos/aducret/Training","forks_url":"https://api.github.com/repos/aducret/Training/forks","keys_url":"https://api.github.com/repos/aducret/Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aducret/Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aducret/Training/teams","hooks_url":"https://api.github.com/repos/aducret/Training/hooks","issue_events_url":"https://api.github.com/repos/aducret/Training/issues/events{/number}","events_url":"https://api.github.com/repos/aducret/Training/events","assignees_url":"https://api.github.com/repos/aducret/Training/assignees{/user}","branches_url":"https://api.github.com/repos/aducret/Training/branches{/branch}","tags_url":"https://api.github.com/repos/aducret/Training/tags","blobs_url":"https://api.github.com/repos/aducret/Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aducret/Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aducret/Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/aducret/Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aducret/Training/statuses/{sha}","languages_url":"https://api.github.com/repos/aducret/Training/languages","stargazers_url":"https://api.github.com/repos/aducret/Training/stargazers","contributors_url":"https://api.github.com/repos/aducret/Training/contributors","subscribers_url":"https://api.github.com/repos/aducret/Training/subscribers","subscription_url":"https://api.github.com/repos/aducret/Training/subscription","commits_url":"https://api.github.com/repos/aducret/Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/aducret/Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/aducret/Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/aducret/Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/aducret/Training/contents/{+path}","compare_url":"https://api.github.com/repos/aducret/Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aducret/Training/merges","archive_url":"https://api.github.com/repos/aducret/Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aducret/Training/downloads","issues_url":"https://api.github.com/repos/aducret/Training/issues{/number}","pulls_url":"https://api.github.com/repos/aducret/Training/pulls{/number}","milestones_url":"https://api.github.com/repos/aducret/Training/milestones{/number}","notifications_url":"https://api.github.com/repos/aducret/Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aducret/Training/labels{/name}","releases_url":"https://api.github.com/repos/aducret/Training/releases{/id}","created_at":"2015-03-25T19:28:50Z","updated_at":"2015-03-25T19:40:18Z","pushed_at":"2015-03-30T16:39:31Z","git_url":"git://github.com/aducret/Training.git","ssh_url":"git@github.com:aducret/Training.git","clone_url":"https://github.com/aducret/Training.git","svn_url":"https://github.com/aducret/Training","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aducret/Training/pulls/1"},"html":{"href":"https://github.com/aducret/Training/pull/1"},"issue":{"href":"https://api.github.com/repos/aducret/Training/issues/1"},"comments":{"href":"https://api.github.com/repos/aducret/Training/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/aducret/Training/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/aducret/Training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aducret/Training/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/aducret/Training/statuses/a2034427565dbff39ddaad1603be4dde95ce8b09"}}}}