{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/firefox-ios/issues/1770","repository_url":"https://api.github.com/repos/mozilla/firefox-ios","labels_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/1770/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/1770/comments","events_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/1770/events","html_url":"https://github.com/mozilla/firefox-ios/pull/1770","id":152784231,"number":1770,"title":"Bug 1223162 - Created base notifications view controller and notification in status bar area when syncing","user":{"login":"sleroux","id":434322,"avatar_url":"https://avatars.githubusercontent.com/u/434322?v=3","gravatar_id":"","url":"https://api.github.com/users/sleroux","html_url":"https://github.com/sleroux","followers_url":"https://api.github.com/users/sleroux/followers","following_url":"https://api.github.com/users/sleroux/following{/other_user}","gists_url":"https://api.github.com/users/sleroux/gists{/gist_id}","starred_url":"https://api.github.com/users/sleroux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleroux/subscriptions","organizations_url":"https://api.github.com/users/sleroux/orgs","repos_url":"https://api.github.com/users/sleroux/repos","events_url":"https://api.github.com/users/sleroux/events{/privacy}","received_events_url":"https://api.github.com/users/sleroux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-03T14:15:54Z","updated_at":"2016-05-04T20:45:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/1770","html_url":"https://github.com/mozilla/firefox-ios/pull/1770","diff_url":"https://github.com/mozilla/firefox-ios/pull/1770.diff","patch_url":"https://github.com/mozilla/firefox-ios/pull/1770.patch"},"body":"Originally I started down the path of using an overlaying UIWindow object to display the notification over the status bar like most of the third-party libraries out there do but that fell apart pretty quickly because of how we show/hide the status bar at various areas of the app (settings, landscape browser). It was also a pain to manage orientation changes since you needed to manually set the transforms yourself since windows are not part of the layout cycle.\r\n\r\nThis approach embeds the root UINavigationController of the app into another view controller. This has a few benefits:\r\n\r\n1. Takes part in the UIViewController lifecycle and view transform changes.\r\n2. Can handle changes like in-call status bars without additional work.\r\n3. Gives us better control over how we animate in not only the notification but also the contents below.\r\n\r\nThe downside to the embedding approach is that we don't show the notification view when we're in settings since that view controller is presented on top of the root UINavigationController one. I don't think this is a problem since we already see the syncing status in the settings anyways. I also think it works in our benefit for when we want to implement the 'Go to Copied Link' banner since it will keep the banner visible in the context of the browser/tab tray only. We can easily extend this controller to include a notification observer for copied links.\r\n\r\nAs always thoughts and concerns most appreciated!"},"comment":{"url":"https://api.github.com/repos/mozilla/firefox-ios/issues/comments/216997407","html_url":"https://github.com/mozilla/firefox-ios/pull/1770#issuecomment-216997407","issue_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/1770","id":216997407,"user":{"login":"sleroux","id":434322,"avatar_url":"https://avatars.githubusercontent.com/u/434322?v=3","gravatar_id":"","url":"https://api.github.com/users/sleroux","html_url":"https://github.com/sleroux","followers_url":"https://api.github.com/users/sleroux/followers","following_url":"https://api.github.com/users/sleroux/following{/other_user}","gists_url":"https://api.github.com/users/sleroux/gists{/gist_id}","starred_url":"https://api.github.com/users/sleroux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleroux/subscriptions","organizations_url":"https://api.github.com/users/sleroux/orgs","repos_url":"https://api.github.com/users/sleroux/repos","events_url":"https://api.github.com/users/sleroux/events{/privacy}","received_events_url":"https://api.github.com/users/sleroux/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T20:45:47Z","updated_at":"2016-05-04T20:45:47Z","body":"Looks like there is a regression when I removed that system check code. After rotating, if you try to do the tray -> browser animation it gets messy. I'll investigate."}}