{"action":"created","issue":{"url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/43","labels_url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/43/comments","events_url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/43/events","html_url":"https://github.com/jaredsinclair/JTSImageViewController/issues/43","id":48856251,"number":43,"title":"view is not in the window hierarchy!","user":{"login":"bluekite2000","id":421581,"avatar_url":"https://avatars.githubusercontent.com/u/421581?v=3","gravatar_id":"","url":"https://api.github.com/users/bluekite2000","html_url":"https://github.com/bluekite2000","followers_url":"https://api.github.com/users/bluekite2000/followers","following_url":"https://api.github.com/users/bluekite2000/following{/other_user}","gists_url":"https://api.github.com/users/bluekite2000/gists{/gist_id}","starred_url":"https://api.github.com/users/bluekite2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluekite2000/subscriptions","organizations_url":"https://api.github.com/users/bluekite2000/orgs","repos_url":"https://api.github.com/users/bluekite2000/repos","events_url":"https://api.github.com/users/bluekite2000/events{/privacy}","received_events_url":"https://api.github.com/users/bluekite2000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-15T00:07:57Z","updated_at":"2015-03-06T17:08:09Z","closed_at":null,"body":"After I added 2 new viewcontrollers A and B before C (which is where timeline is added) I get \r\nWarning: Attempt to present <JTSImageViewController: 0x137083c00> on <UIViewController: 0x136e0d130> whose view is not in the window hierarchy!\r\n\r\nMy question is in line \r\n\timageViewer!.showFromViewController(UIApplication.sharedApplication().keyWindow?.rootViewController, transition: JTSImageViewControllerTransition._FromOriginalPosition) \r\n\r\nI need to replace UIApplication.sharedApplication().keyWindow?.rootViewController with sth in order to access C. What to do?\r\n"},"comment":{"url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/comments/77595530","html_url":"https://github.com/jaredsinclair/JTSImageViewController/issues/43#issuecomment-77595530","issue_url":"https://api.github.com/repos/jaredsinclair/JTSImageViewController/issues/43","id":77595530,"user":{"login":"MuscleRumble","id":2924160,"avatar_url":"https://avatars.githubusercontent.com/u/2924160?v=3","gravatar_id":"","url":"https://api.github.com/users/MuscleRumble","html_url":"https://github.com/MuscleRumble","followers_url":"https://api.github.com/users/MuscleRumble/followers","following_url":"https://api.github.com/users/MuscleRumble/following{/other_user}","gists_url":"https://api.github.com/users/MuscleRumble/gists{/gist_id}","starred_url":"https://api.github.com/users/MuscleRumble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuscleRumble/subscriptions","organizations_url":"https://api.github.com/users/MuscleRumble/orgs","repos_url":"https://api.github.com/users/MuscleRumble/repos","events_url":"https://api.github.com/users/MuscleRumble/events{/privacy}","received_events_url":"https://api.github.com/users/MuscleRumble/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T17:08:09Z","updated_at":"2015-03-06T17:08:09Z","body":"I had this issue, too... with `UILongPressGestureRecognizer` on a `UICollectionViewCell`. But that was totally fine, because the gesture recognizer event is called twice.\r\n\r\nCheck for this `if (gesture.state == UIGestureRecognizerStateBegan)` and `UIGestureRecognizerStateEnded ` should be ignored."}}