{"id":2096,"date":"2016-07-13T05:54:50","date_gmt":"2016-07-13T09:54:50","guid":{"rendered":"http:\/\/www.rexfeng.com\/blog\/?p=2096"},"modified":"2016-07-13T05:54:50","modified_gmt":"2016-07-13T09:54:50","slug":"ios-universal-ipad-portrait-gotcha","status":"publish","type":"post","link":"https:\/\/www.rexfeng.com\/blog\/2016\/07\/ios-universal-ipad-portrait-gotcha\/","title":{"rendered":"iOS Universal iPad Portrait Gotcha"},"content":{"rendered":"<p>I wanted to share a small tip that reinforces the necessity of on-device (non-simulator) testing.<\/p>\n<p>While finalizing my latest iOS app (universal for both iPhone &amp; iPad), I found\u00a0an issue through manual QA on an actual\u00a0iPad. I had only left Portrait checked in the Project &gt; General section of Xcode, but my app was somehow running in landscape mode on the iPad.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2097\" src=\"http:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/general.png\" alt=\"general\" width=\"362\" height=\"146\" srcset=\"https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/general.png 362w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/general-150x60.png 150w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/general-300x121.png 300w\" sizes=\"auto, (max-width: 362px) 100vw, 362px\" \/><\/p>\n<p>Confused as to why it was rendering in both landscape &amp; portrait mode on my iPad, I found a <a href=\"http:\/\/stackoverflow.com\/questions\/27782224\/universal-application-with-portrait-orientation-for-iphone-and-landscape-orienta\">handy stack overflow post<\/a>.<\/p>\n<p>For one reason or another, you have to update your Info.plist to only specify portrait settings for iPads. Below is my Info.plist after I updated it to only target Portrait mode.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2098\" src=\"http:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/info_plist-540x88.png\" alt=\"info_plist\" width=\"540\" height=\"88\" srcset=\"https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/info_plist-540x88.png 540w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/info_plist-150x24.png 150w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/info_plist-300x49.png 300w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2016\/07\/info_plist.png 596w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/p>\n<p>It&#8217;s confusing as to why the Project General section&#8217;s Device Orientation is not sufficient to force only Portrait orientations and you have to also update the Info.plist.<\/p>\n<p>Through simulator testing, it&#8217;s not likely that I would have caught onto this portrait vs landscape issue. I relied mostly on my primary iPhone and copious amounts of simulator testing for the other iOS universal devices.<\/p>\n<p>For the highest level of quality control, you would need an iPhone 4s, iPhone 5, iPhone 6, iPhone 6+, iPad, and iPad Pro. That&#8217;s a lot of devices and I certainly don&#8217;t have all of those. <em>Sidenote: if you do have all those devices, you would also be\u00a0positioned to record App Preview videos for all devices natively (AKA lots of work).<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to share a small tip that reinforces the necessity of on-device (non-simulator) testing. While finalizing my latest iOS app (universal for both iPhone &amp; iPad), I found\u00a0an issue through manual QA on an actual\u00a0iPad. I had only left Portrait checked in the Project &gt; General section of Xcode, but my app was somehow [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1029],"tags":[966,550,471,1295,1086],"class_list":["post-2096","post","type-post","status-publish","format-standard","hentry","category-programming","tag-ios","tag-ipad","tag-iphone","tag-universal","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/comments?post=2096"}],"version-history":[{"count":5,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions"}],"predecessor-version":[{"id":2103,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions\/2103"}],"wp:attachment":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/media?parent=2096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/categories?post=2096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/tags?post=2096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}