{"action":"created","comment":{"url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/comments/54345705","id":54345705,"diff_hunk":"@@ -0,0 +1,177 @@\n+// Copyright (c) 2016 Lightricks. All rights reserved.\n+// Created by Gennadi Iosad.\n+\n+#import \"DetailsPhotoViewController.h\"\n+\n+#import \"PhotosHistory.h\"\n+\n+NS_ASSUME_NONNULL_BEGIN\n+\n+@interface DetailsPhotoViewController() <UIScrollViewDelegate>\n+\n+@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *spinner;\n+\n+@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;\n+\n+@property (weak, nonatomic) IBOutlet UILabel *noImageLoadedView;\n+\n+@property (strong, nonatomic) UIImageView *imageView;\n+\n+@property (strong, nonatomic) id<CancellableTask> downloadTask;\n+\n+@end\n+\n+@implementation DetailsPhotoViewController\n+\n+#pragma mark -\n+#pragma mark UIViewController overrides\n+#pragma mark -\n+\n+- (void)viewDidLoad {\n+  [super viewDidLoad];\n+  self.scrollView.delegate = self;\n+  UITapGestureRecognizer *doubleTapRecognizer =\n+      [[UITapGestureRecognizer alloc] initWithTarget:self\n+                                              action:@selector(scrollViewDoubleFingerTapped:)];\n+  doubleTapRecognizer.numberOfTapsRequired = 2;\n+  doubleTapRecognizer.numberOfTouchesRequired = 1;\n+  [self.scrollView addGestureRecognizer:doubleTapRecognizer];\n+  [self loadImage];\n+  NSLog(@\"DetailsPhotoViewController::viewDidLoad self %p\", self);\n+}\n+\n+- (void)scrollViewDoubleFingerTapped:(UITapGestureRecognizer*)recognizer {\n+  //if already zoomed out - zoom in a bit\n+  if (self.scrollView.zoomScale == self.scrollView.minimumZoomScale) {\n+    [self.scrollView setZoomScale:self.scrollView.zoomScale*2 animated:YES];\n+  } else {\n+    //zoom out\n+    [self.scrollView setZoomScale:self.scrollView.minimumZoomScale animated:YES];\n+  }\n+}\n+\n+- (void)viewDidAppear:(BOOL)animated {\n+  NSLog(@\"DetailsPhotoViewController::viewDidAppear\");\n+  [super viewDidAppear:animated];\n+}\n+\n+- (void)viewDidLayoutSubviews {\n+  NSLog(@\"DetailsPhotoViewController::viewDidLayoutSubviews\");\n+  [super viewDidLayoutSubviews];\n+\n+  if (self.imageView) {\n+    [self aspectFitImage];\n+  }\n+}\n+\n+- (void) dealloc {\n+  NSLog(@\"DetailsPhotoViewController::dealloc\");\n+  [self.downloadTask cancel];\n+}\n+\n+#pragma mark -\n+#pragma mark UIScrollViewDelegate impl\n+#pragma mark -\n+\n+- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {\n+  return self.imageView;\n+}\n+\n+- (void)scrollViewDidZoom:(UIScrollView *)scrollView {\n+  // The scroll view has zoomed, so you need to re-center the contents\n+  [self centerScrollViewContents];\n+}\n+\n+#pragma mark -\n+#pragma mark aux logic","path":"TopPlaces/TopPlaces/Controllers/DetailsPhotoViewController.m","position":86,"original_position":86,"commit_id":"2457237711167f3a091f8c4fe6a20a06d9178a57","original_commit_id":"2457237711167f3a091f8c4fe6a20a06d9178a57","user":{"login":"dlahyani","id":8058495,"avatar_url":"https://avatars.githubusercontent.com/u/8058495?v=3","gravatar_id":"","url":"https://api.github.com/users/dlahyani","html_url":"https://github.com/dlahyani","followers_url":"https://api.github.com/users/dlahyani/followers","following_url":"https://api.github.com/users/dlahyani/following{/other_user}","gists_url":"https://api.github.com/users/dlahyani/gists{/gist_id}","starred_url":"https://api.github.com/users/dlahyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlahyani/subscriptions","organizations_url":"https://api.github.com/users/dlahyani/orgs","repos_url":"https://api.github.com/users/dlahyani/repos","events_url":"https://api.github.com/users/dlahyani/events{/privacy}","received_events_url":"https://api.github.com/users/dlahyani/received_events","type":"User","site_admin":false},"body":"<code>aux logic</code> => <code>Auxiliary Logic</code>","created_at":"2016-02-28T08:07:57Z","updated_at":"2016-02-28T08:07:57Z","html_url":"https://github.com/dlahyani/TopPlaces/pull/3#discussion_r54345705","pull_request_url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/comments/54345705"},"html":{"href":"https://github.com/dlahyani/TopPlaces/pull/3#discussion_r54345705"},"pull_request":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3","id":59364309,"html_url":"https://github.com/dlahyani/TopPlaces/pull/3","diff_url":"https://github.com/dlahyani/TopPlaces/pull/3.diff","patch_url":"https://github.com/dlahyani/TopPlaces/pull/3.patch","issue_url":"https://api.github.com/repos/dlahyani/TopPlaces/issues/3","number":3,"state":"open","locked":false,"title":"Feature/flickr top places","user":{"login":"giosad","id":16525865,"avatar_url":"https://avatars.githubusercontent.com/u/16525865?v=3","gravatar_id":"","url":"https://api.github.com/users/giosad","html_url":"https://github.com/giosad","followers_url":"https://api.github.com/users/giosad/followers","following_url":"https://api.github.com/users/giosad/following{/other_user}","gists_url":"https://api.github.com/users/giosad/gists{/gist_id}","starred_url":"https://api.github.com/users/giosad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giosad/subscriptions","organizations_url":"https://api.github.com/users/giosad/orgs","repos_url":"https://api.github.com/users/giosad/repos","events_url":"https://api.github.com/users/giosad/events{/privacy}","received_events_url":"https://api.github.com/users/giosad/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-15T13:35:23Z","updated_at":"2016-02-28T08:07:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe36f447a157fd73a8e84a0337d38dcb4de22e34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3/commits","review_comments_url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3/comments","review_comment_url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlahyani/TopPlaces/issues/3/comments","statuses_url":"https://api.github.com/repos/dlahyani/TopPlaces/statuses/2457237711167f3a091f8c4fe6a20a06d9178a57","head":{"label":"giosad:feature/flickr-top-places","ref":"feature/flickr-top-places","sha":"2457237711167f3a091f8c4fe6a20a06d9178a57","user":{"login":"giosad","id":16525865,"avatar_url":"https://avatars.githubusercontent.com/u/16525865?v=3","gravatar_id":"","url":"https://api.github.com/users/giosad","html_url":"https://github.com/giosad","followers_url":"https://api.github.com/users/giosad/followers","following_url":"https://api.github.com/users/giosad/following{/other_user}","gists_url":"https://api.github.com/users/giosad/gists{/gist_id}","starred_url":"https://api.github.com/users/giosad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giosad/subscriptions","organizations_url":"https://api.github.com/users/giosad/orgs","repos_url":"https://api.github.com/users/giosad/repos","events_url":"https://api.github.com/users/giosad/events{/privacy}","received_events_url":"https://api.github.com/users/giosad/received_events","type":"User","site_admin":false},"repo":{"id":50441483,"name":"TopPlaces","full_name":"giosad/TopPlaces","owner":{"login":"giosad","id":16525865,"avatar_url":"https://avatars.githubusercontent.com/u/16525865?v=3","gravatar_id":"","url":"https://api.github.com/users/giosad","html_url":"https://github.com/giosad","followers_url":"https://api.github.com/users/giosad/followers","following_url":"https://api.github.com/users/giosad/following{/other_user}","gists_url":"https://api.github.com/users/giosad/gists{/gist_id}","starred_url":"https://api.github.com/users/giosad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giosad/subscriptions","organizations_url":"https://api.github.com/users/giosad/orgs","repos_url":"https://api.github.com/users/giosad/repos","events_url":"https://api.github.com/users/giosad/events{/privacy}","received_events_url":"https://api.github.com/users/giosad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/giosad/TopPlaces","description":"","fork":false,"url":"https://api.github.com/repos/giosad/TopPlaces","forks_url":"https://api.github.com/repos/giosad/TopPlaces/forks","keys_url":"https://api.github.com/repos/giosad/TopPlaces/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giosad/TopPlaces/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giosad/TopPlaces/teams","hooks_url":"https://api.github.com/repos/giosad/TopPlaces/hooks","issue_events_url":"https://api.github.com/repos/giosad/TopPlaces/issues/events{/number}","events_url":"https://api.github.com/repos/giosad/TopPlaces/events","assignees_url":"https://api.github.com/repos/giosad/TopPlaces/assignees{/user}","branches_url":"https://api.github.com/repos/giosad/TopPlaces/branches{/branch}","tags_url":"https://api.github.com/repos/giosad/TopPlaces/tags","blobs_url":"https://api.github.com/repos/giosad/TopPlaces/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giosad/TopPlaces/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giosad/TopPlaces/git/refs{/sha}","trees_url":"https://api.github.com/repos/giosad/TopPlaces/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giosad/TopPlaces/statuses/{sha}","languages_url":"https://api.github.com/repos/giosad/TopPlaces/languages","stargazers_url":"https://api.github.com/repos/giosad/TopPlaces/stargazers","contributors_url":"https://api.github.com/repos/giosad/TopPlaces/contributors","subscribers_url":"https://api.github.com/repos/giosad/TopPlaces/subscribers","subscription_url":"https://api.github.com/repos/giosad/TopPlaces/subscription","commits_url":"https://api.github.com/repos/giosad/TopPlaces/commits{/sha}","git_commits_url":"https://api.github.com/repos/giosad/TopPlaces/git/commits{/sha}","comments_url":"https://api.github.com/repos/giosad/TopPlaces/comments{/number}","issue_comment_url":"https://api.github.com/repos/giosad/TopPlaces/issues/comments{/number}","contents_url":"https://api.github.com/repos/giosad/TopPlaces/contents/{+path}","compare_url":"https://api.github.com/repos/giosad/TopPlaces/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giosad/TopPlaces/merges","archive_url":"https://api.github.com/repos/giosad/TopPlaces/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giosad/TopPlaces/downloads","issues_url":"https://api.github.com/repos/giosad/TopPlaces/issues{/number}","pulls_url":"https://api.github.com/repos/giosad/TopPlaces/pulls{/number}","milestones_url":"https://api.github.com/repos/giosad/TopPlaces/milestones{/number}","notifications_url":"https://api.github.com/repos/giosad/TopPlaces/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giosad/TopPlaces/labels{/name}","releases_url":"https://api.github.com/repos/giosad/TopPlaces/releases{/id}","deployments_url":"https://api.github.com/repos/giosad/TopPlaces/deployments","created_at":"2016-01-26T16:19:56Z","updated_at":"2016-01-27T08:38:06Z","pushed_at":"2016-02-24T07:59:54Z","git_url":"git://github.com/giosad/TopPlaces.git","ssh_url":"git@github.com:giosad/TopPlaces.git","clone_url":"https://github.com/giosad/TopPlaces.git","svn_url":"https://github.com/giosad/TopPlaces","homepage":null,"size":118,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"dlahyani:develop","ref":"develop","sha":"17a591eaa10977bba2fbb2107d21c14a5662865a","user":{"login":"dlahyani","id":8058495,"avatar_url":"https://avatars.githubusercontent.com/u/8058495?v=3","gravatar_id":"","url":"https://api.github.com/users/dlahyani","html_url":"https://github.com/dlahyani","followers_url":"https://api.github.com/users/dlahyani/followers","following_url":"https://api.github.com/users/dlahyani/following{/other_user}","gists_url":"https://api.github.com/users/dlahyani/gists{/gist_id}","starred_url":"https://api.github.com/users/dlahyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlahyani/subscriptions","organizations_url":"https://api.github.com/users/dlahyani/orgs","repos_url":"https://api.github.com/users/dlahyani/repos","events_url":"https://api.github.com/users/dlahyani/events{/privacy}","received_events_url":"https://api.github.com/users/dlahyani/received_events","type":"User","site_admin":false},"repo":{"id":51247463,"name":"TopPlaces","full_name":"dlahyani/TopPlaces","owner":{"login":"dlahyani","id":8058495,"avatar_url":"https://avatars.githubusercontent.com/u/8058495?v=3","gravatar_id":"","url":"https://api.github.com/users/dlahyani","html_url":"https://github.com/dlahyani","followers_url":"https://api.github.com/users/dlahyani/followers","following_url":"https://api.github.com/users/dlahyani/following{/other_user}","gists_url":"https://api.github.com/users/dlahyani/gists{/gist_id}","starred_url":"https://api.github.com/users/dlahyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlahyani/subscriptions","organizations_url":"https://api.github.com/users/dlahyani/orgs","repos_url":"https://api.github.com/users/dlahyani/repos","events_url":"https://api.github.com/users/dlahyani/events{/privacy}","received_events_url":"https://api.github.com/users/dlahyani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dlahyani/TopPlaces","description":"","fork":true,"url":"https://api.github.com/repos/dlahyani/TopPlaces","forks_url":"https://api.github.com/repos/dlahyani/TopPlaces/forks","keys_url":"https://api.github.com/repos/dlahyani/TopPlaces/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlahyani/TopPlaces/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlahyani/TopPlaces/teams","hooks_url":"https://api.github.com/repos/dlahyani/TopPlaces/hooks","issue_events_url":"https://api.github.com/repos/dlahyani/TopPlaces/issues/events{/number}","events_url":"https://api.github.com/repos/dlahyani/TopPlaces/events","assignees_url":"https://api.github.com/repos/dlahyani/TopPlaces/assignees{/user}","branches_url":"https://api.github.com/repos/dlahyani/TopPlaces/branches{/branch}","tags_url":"https://api.github.com/repos/dlahyani/TopPlaces/tags","blobs_url":"https://api.github.com/repos/dlahyani/TopPlaces/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlahyani/TopPlaces/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlahyani/TopPlaces/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlahyani/TopPlaces/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlahyani/TopPlaces/statuses/{sha}","languages_url":"https://api.github.com/repos/dlahyani/TopPlaces/languages","stargazers_url":"https://api.github.com/repos/dlahyani/TopPlaces/stargazers","contributors_url":"https://api.github.com/repos/dlahyani/TopPlaces/contributors","subscribers_url":"https://api.github.com/repos/dlahyani/TopPlaces/subscribers","subscription_url":"https://api.github.com/repos/dlahyani/TopPlaces/subscription","commits_url":"https://api.github.com/repos/dlahyani/TopPlaces/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlahyani/TopPlaces/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlahyani/TopPlaces/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlahyani/TopPlaces/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlahyani/TopPlaces/contents/{+path}","compare_url":"https://api.github.com/repos/dlahyani/TopPlaces/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlahyani/TopPlaces/merges","archive_url":"https://api.github.com/repos/dlahyani/TopPlaces/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlahyani/TopPlaces/downloads","issues_url":"https://api.github.com/repos/dlahyani/TopPlaces/issues{/number}","pulls_url":"https://api.github.com/repos/dlahyani/TopPlaces/pulls{/number}","milestones_url":"https://api.github.com/repos/dlahyani/TopPlaces/milestones{/number}","notifications_url":"https://api.github.com/repos/dlahyani/TopPlaces/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlahyani/TopPlaces/labels{/name}","releases_url":"https://api.github.com/repos/dlahyani/TopPlaces/releases{/id}","deployments_url":"https://api.github.com/repos/dlahyani/TopPlaces/deployments","created_at":"2016-02-07T12:52:07Z","updated_at":"2016-02-07T13:09:27Z","pushed_at":"2016-02-24T07:59:55Z","git_url":"git://github.com/dlahyani/TopPlaces.git","ssh_url":"git@github.com:dlahyani/TopPlaces.git","clone_url":"https://github.com/dlahyani/TopPlaces.git","svn_url":"https://github.com/dlahyani/TopPlaces","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"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/dlahyani/TopPlaces/pulls/3"},"html":{"href":"https://github.com/dlahyani/TopPlaces/pull/3"},"issue":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/issues/3"},"comments":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/dlahyani/TopPlaces/statuses/2457237711167f3a091f8c4fe6a20a06d9178a57"}}}}