{"action":"created","issue":{"url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/1632","repository_url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController","labels_url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/1632/labels{/name}","comments_url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/1632/comments","events_url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/1632/events","html_url":"https://github.com/jessesquires/JSQMessagesViewController/issues/1632","id":158164489,"number":1632,"title":"Displaying of more than one JSQLocationMediaItem at the same time breaks navigation bar push/pop animation","user":{"login":"nyekimov","id":1243986,"avatar_url":"https://avatars.githubusercontent.com/u/1243986?v=3","gravatar_id":"","url":"https://api.github.com/users/nyekimov","html_url":"https://github.com/nyekimov","followers_url":"https://api.github.com/users/nyekimov/followers","following_url":"https://api.github.com/users/nyekimov/following{/other_user}","gists_url":"https://api.github.com/users/nyekimov/gists{/gist_id}","starred_url":"https://api.github.com/users/nyekimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyekimov/subscriptions","organizations_url":"https://api.github.com/users/nyekimov/orgs","repos_url":"https://api.github.com/users/nyekimov/repos","events_url":"https://api.github.com/users/nyekimov/events{/privacy}","received_events_url":"https://api.github.com/users/nyekimov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-02T15:06:55Z","updated_at":"2016-06-02T16:32:17Z","closed_at":null,"body":"I've experienced issue with loading multiple JSQLocationMediaItems in a chat. I've added steps to reproduce, just assume that while showing the chat you receive multiple messages with location and try to display them, then go back and again to the chat several times and observe that at some point navigation bar stops pop/push animations (more JSQLocationMediaItems you have - it happens faster) \r\n\r\n```\r\n    @implementation DemoMessagesViewController\r\n\r\n- (void)viewDidLoad\r\n{\r\n    [super viewDidLoad];\r\n   ...\r\n    __weak UICollectionView *weakView = self.collectionView;\r\n    \r\n    [self.demoData addLocationMediaMessageCompletion:^{\r\n        [weakView reloadData];\r\n    }];\r\n\r\n    [self.demoData addLocationMediaMessageCompletion:^{\r\n        [weakView reloadData];\r\n    }];\r\n\r\n    [self.demoData addLocationMediaMessageCompletion:^{\r\n        [weakView reloadData];\r\n    }];\r\n}\r\n```\r\n\r\nThe code below causes the issue, playing with dispatch_queues breaks the main UI.\r\n\r\n```\r\n @implementation JSQLocationMediaItem\r\n\r\n- (void)createMapViewSnapshotForLocation:(CLLocation *)location\r\n                        coordinateRegion:(MKCoordinateRegion)region\r\n                   withCompletionHandler:(JSQLocationMediaItemCompletionBlock)completion\r\n{\r\n  ...\r\n    \r\n    MKMapSnapshotter *snapShotter = [[MKMapSnapshotter alloc] initWithOptions:options];\r\n    \r\n    [snapShotter startWithQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)\r\n              completionHandler:^(MKMapSnapshot *snapshot, NSError *error) {\r\n\r\n                  ....\r\n                  if (completion) {\r\n                      dispatch_async(dispatch_get_main_queue(), completion);\r\n                  }\r\n              }];\r\n}\r\n```\r\n\r\nFound second scenario, just send more than one location at a time, modify code, pop/push demochatview several times and send location message each time and observe that push/pop animation is broken. \r\n\r\n```\r\n- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex\r\n{\r\n ....\r\n    \r\n    switch (buttonIndex) {\r\n      ....\r\n            \r\n        case 1:\r\n        {\r\n            __weak UICollectionView *weakView = self.collectionView;\r\n            \r\n            [self.demoData addLocationMediaMessageCompletion:^{\r\n                [weakView reloadData];\r\n            }];\r\n            \r\n            [self.demoData addLocationMediaMessageCompletion:^{\r\n                [weakView reloadData];\r\n            }];\r\n            \r\n            [self.demoData addLocationMediaMessageCompletion:^{\r\n                [weakView reloadData];\r\n            }];\r\n            \r\n        }\r\n        ...\r\n    }\r\n    \r\n    [JSQSystemSoundPlayer jsq_playMessageSentSound];\r\n    \r\n    [self finishSendingMessageAnimated:YES];\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/comments/223347129","html_url":"https://github.com/jessesquires/JSQMessagesViewController/issues/1632#issuecomment-223347129","issue_url":"https://api.github.com/repos/jessesquires/JSQMessagesViewController/issues/1632","id":223347129,"user":{"login":"jessesquires","id":2301114,"avatar_url":"https://avatars.githubusercontent.com/u/2301114?v=3","gravatar_id":"","url":"https://api.github.com/users/jessesquires","html_url":"https://github.com/jessesquires","followers_url":"https://api.github.com/users/jessesquires/followers","following_url":"https://api.github.com/users/jessesquires/following{/other_user}","gists_url":"https://api.github.com/users/jessesquires/gists{/gist_id}","starred_url":"https://api.github.com/users/jessesquires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessesquires/subscriptions","organizations_url":"https://api.github.com/users/jessesquires/orgs","repos_url":"https://api.github.com/users/jessesquires/repos","events_url":"https://api.github.com/users/jessesquires/events{/privacy}","received_events_url":"https://api.github.com/users/jessesquires/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T16:32:16Z","updated_at":"2016-06-02T16:32:16Z","body":"Thanks @nyekimov !\r\n\r\nOne more thing -- any logs you can provide as well?"}}
{"actor":{"display_login":"jessesquires"}}