{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3158","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3158/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3158/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3158/events","html_url":"https://github.com/openframeworks/openFrameworks/issues/3158","id":40740081,"number":3158,"title":"iOS 8 breaks OF handling of Hardware Orientation","user":{"login":"aefreedman","id":2312562,"avatar_url":"https://avatars.githubusercontent.com/u/2312562?v=3","gravatar_id":"","url":"https://api.github.com/users/aefreedman","html_url":"https://github.com/aefreedman","followers_url":"https://api.github.com/users/aefreedman/followers","following_url":"https://api.github.com/users/aefreedman/following{/other_user}","gists_url":"https://api.github.com/users/aefreedman/gists{/gist_id}","starred_url":"https://api.github.com/users/aefreedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aefreedman/subscriptions","organizations_url":"https://api.github.com/users/aefreedman/orgs","repos_url":"https://api.github.com/users/aefreedman/repos","events_url":"https://api.github.com/users/aefreedman/events{/privacy}","received_events_url":"https://api.github.com/users/aefreedman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/iOS","name":"iOS","color":"2babad"}],"state":"open","locked":false,"assignee":{"login":"julapy","id":331382,"avatar_url":"https://avatars.githubusercontent.com/u/331382?v=3","gravatar_id":"","url":"https://api.github.com/users/julapy","html_url":"https://github.com/julapy","followers_url":"https://api.github.com/users/julapy/followers","following_url":"https://api.github.com/users/julapy/following{/other_user}","gists_url":"https://api.github.com/users/julapy/gists{/gist_id}","starred_url":"https://api.github.com/users/julapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julapy/subscriptions","organizations_url":"https://api.github.com/users/julapy/orgs","repos_url":"https://api.github.com/users/julapy/repos","events_url":"https://api.github.com/users/julapy/events{/privacy}","received_events_url":"https://api.github.com/users/julapy/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/8","html_url":"https://github.com/openframeworks/openFrameworks/milestones/0.9.0","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/8/labels","id":88731,"number":8,"title":"0.9.0","description":"Originally aimed for release on November 10th with initial emscripten support, Apothecary compiled libs and C++11/64-bit support on OSX. Pushed back to January 12, multiwindow support was added. Deadline removed on January 4. Deadline added again on February 8 as May 18.","creator":{"login":"bilderbuchi","id":327442,"avatar_url":"https://avatars.githubusercontent.com/u/327442?v=3","gravatar_id":"","url":"https://api.github.com/users/bilderbuchi","html_url":"https://github.com/bilderbuchi","followers_url":"https://api.github.com/users/bilderbuchi/followers","following_url":"https://api.github.com/users/bilderbuchi/following{/other_user}","gists_url":"https://api.github.com/users/bilderbuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/bilderbuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilderbuchi/subscriptions","organizations_url":"https://api.github.com/users/bilderbuchi/orgs","repos_url":"https://api.github.com/users/bilderbuchi/repos","events_url":"https://api.github.com/users/bilderbuchi/events{/privacy}","received_events_url":"https://api.github.com/users/bilderbuchi/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":179,"state":"open","created_at":"2012-02-25T01:34:28Z","updated_at":"2015-05-17T14:09:38Z","due_on":"2015-05-18T04:00:00Z","closed_at":null},"comments":16,"created_at":"2014-08-20T20:18:39Z","updated_at":"2015-05-18T07:18:37Z","closed_at":null,"body":"I haven't fully investigated the root cause, but the problem is related to iOS 8 changes to how it controls view bounding boxes. It seems that they do not change after rotation.\r\n\r\nI'm cross-referencing issues #931, #1477, and #1976, though I'm making a new issue because my understanding that this is a iOS 8 specific issue, though related.\r\n\r\nEdit: Also cross-referencing PR #2290. Also linking related forum [thread](http://forum.openframeworks.cc/t/ios-8-of-not-setting-orientation-properly/16729).\r\n\r\nObserved behavior: using current versions if iOS + OF, the app will appear to always start in Portrait, despite setting the project to start in Landscape and disabling all Portrait orientations. You'll typically see a blank region on the right-hand side of your screen. It seems that your app is drawing Landscape while the device is oriented Portrait.\r\n\r\n~~Disabling hardware orientation will allow you to draw the app correctly, but the device will always orient as Portrait. Additionally, activating the Notification or Control Center can cause the app to suddenly change orientation.~~ \r\n\r\nUpdate (10/13):\r\nI'm currently using \r\nXcode 6\r\nOS X 10.10 Beta 5\r\nLatest OF Master as of 10/13\r\niPhone 6 w/ iOS 8.0.2\r\n\r\n~~Project details:\r\nXcode 6 beta 6\r\nOS X 10.10 (14A299l)\r\nOF 0.8.3 (I've looked through the current master and nothing looks like it applies)\r\nTested on: iPhone 5s (7.1.2), iPad Air (7.1.2), iPad 2 (8.0 (12A4345d))~~\r\n\r\nPotential Fix:\r\nthe ofxiOSViewController is switching the width and height values based on orientation to get the correct center and bounding box. This is apparently unnecessary in iOS 8.\r\n\r\nThe following changes to ofxiOSViewController.mm will keep orientation working on iOS 8 without breaking previous versions. This change causes some unwanted behavior from the orientation animation that I haven't looked into yet (it seems to rotate around twice).\r\n\r\nIn rotateToInterfaceDirection the following (148-163):\r\n\r\n    CGSize screenSize = [UIScreen mainScreen].bounds.size;\r\n    \r\n    CGPoint center;\r\n    if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {\r\n        center.x = screenSize.height * 0.5;\r\n        center.y = screenSize.width * 0.5;\r\n    } else {\r\n        center.x = screenSize.width * 0.5;\r\n        center.y = screenSize.height * 0.5;\r\n    }\r\n    \r\n    CGRect bounds = CGRectMake(0, 0, screenSize.width, screenSize.height);\r\n    if(UIInterfaceOrientationIsLandscape(interfaceOrientation)) {\r\n        bounds.size.width = screenSize.height;\r\n        bounds.size.height = screenSize.width;\r\n    }\r\n\r\nshould be:\r\n\r\n    CGSize screenSize = [UIScreen mainScreen].bounds.size;\r\n    CGPoint center;\r\n    CGRect bounds = CGRectMake(0, 0, screenSize.width, screenSize.height);\r\n    \r\n    // Is the iOS version less than 8?\r\n    if( [[[UIDevice currentDevice] systemVersion] compare:@\"8.0\" options:NSNumericSearch] == NSOrderedAscending ) {\r\n        if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {\r\n            center.x = screenSize.height * 0.5;\r\n            center.y = screenSize.width * 0.5;\r\n        } else {\r\n            center.x = screenSize.width * 0.5;\r\n            center.y = screenSize.height * 0.5;\r\n        }\r\n\r\n        if(UIInterfaceOrientationIsLandscape(interfaceOrientation)) {\r\n            bounds.size.width = screenSize.height;\r\n            bounds.size.height = screenSize.width;\r\n        }\r\n    } else {\r\n        center.x = screenSize.width * 0.5;\r\n        center.y = screenSize.height * 0.5;\r\n    }\r\n\r\nadditionally in willAnimateRotationToInterfaceOrientation, lines 224-233:\r\n\r\n    CGSize screenSize = [UIScreen mainScreen].bounds.size;\r\n    \r\n    CGPoint center;\r\n    if(UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {\r\n        center.x = screenSize.height * 0.5;\r\n        center.y = screenSize.width * 0.5;\r\n    } else {\r\n        center.x = screenSize.width * 0.5;\r\n        center.y = screenSize.height * 0.5;\r\n    }\r\n\r\nshould instead be:\r\n\r\n    CGSize screenSize = [UIScreen mainScreen].bounds.size;\r\n    \r\n    CGPoint center;\r\n    // Is the iOS version less than 8?\r\n    if( [[[UIDevice currentDevice] systemVersion] compare:@\"8.0\" options:NSNumericSearch] == NSOrderedAscending ) {\r\n        if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {\r\n            center.x = screenSize.height * 0.5;\r\n            center.y = screenSize.width * 0.5;\r\n        } else {\r\n            center.x = screenSize.width * 0.5;\r\n            center.y = screenSize.height * 0.5;\r\n        }\r\n    } else {\r\n        center.x = screenSize.width * 0.5;\r\n        center.y = screenSize.height * 0.5;\r\n    }"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/102945576","html_url":"https://github.com/openframeworks/openFrameworks/issues/3158#issuecomment-102945576","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3158","id":102945576,"user":{"login":"susemiessner","id":3738517,"avatar_url":"https://avatars.githubusercontent.com/u/3738517?v=3","gravatar_id":"","url":"https://api.github.com/users/susemiessner","html_url":"https://github.com/susemiessner","followers_url":"https://api.github.com/users/susemiessner/followers","following_url":"https://api.github.com/users/susemiessner/following{/other_user}","gists_url":"https://api.github.com/users/susemiessner/gists{/gist_id}","starred_url":"https://api.github.com/users/susemiessner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/susemiessner/subscriptions","organizations_url":"https://api.github.com/users/susemiessner/orgs","repos_url":"https://api.github.com/users/susemiessner/repos","events_url":"https://api.github.com/users/susemiessner/events{/privacy}","received_events_url":"https://api.github.com/users/susemiessner/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T07:18:37Z","updated_at":"2015-05-18T07:18:37Z","body":"if I see correctly this issue still exists... at least I just checked the iOSOrientationExample on a couple of different devices and the issue still persists. the solution of @aefreedman doesn't seem implemented in current build (0.8.4). could someone tell me where to find ofxiOSViewController in OF folder structure? Would like to try the code suggested"}}