{"id":533,"date":"2013-12-05T13:34:22","date_gmt":"2013-12-05T19:34:22","guid":{"rendered":"https:\/\/halsafar.ca\/blog\/?p=533"},"modified":"2015-08-26T10:27:57","modified_gmt":"2015-08-26T16:27:57","slug":"ios-launch-image-for-landscape-only-app-for-iphones","status":"publish","type":"post","link":"https:\/\/halsafar.ca\/blog\/2013\/12\/05\/ios-launch-image-for-landscape-only-app-for-iphones\/","title":{"rendered":"IOS Launch Image For Landscape Only App for iPhone&#8217;s"},"content":{"rendered":"<p>Nearing the end of an app development cycle it came time to add a splash screen or in IOS SDK terms the LaunchImage. \u00a0The app in question is to be locked in landscape mode as per request of the client. \u00a0There is no way to specify a launch image for phones in landscape mode. \u00a0If you are using Images.xcassets then you have probably already noticed this.<\/p>\n<p>The following is a very quick and simple way to fix this.<\/p>\n<ol>\n<li>To start, you will need to design your launch image using portrait dimensions. \u00a0This is very simple, just rotate the image you want to use as a launch image by 90 degrees.<\/li>\n<li>There are several ways to specify your Launch Image and this is not the subject of this document. \u00a0For me I used Images.xcassets to setup the Launch Images. \u00a0Take your rotated landscape ready portrait dimensions image and place it into the Images.xcassets appropriately.<\/li>\n<li>Re-Enable portrait mode in your Application Settings. \u00a0You can do this via YOURAPP-Info.plist or in the project settings. \u00a0Make sure if you do it within YOURAPP-Info.plist that portrait mode is first.<\/li>\n<li>Add the following code snippet to AppDelegate.m (change that return value appropriately for your app):<br \/>\n<code><br \/>\n-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window<br \/>\n{<br \/>\n<\/code><\/p>\n<blockquote style=\"margin: 0 0 0 20px; border: none; padding: 0px;\"><p><code> return UIInterfaceOrientationMaskLandscapeRight;<\/code><\/p><\/blockquote>\n<p><code> }<\/code><\/p>\n<p>&nbsp;<\/li>\n<li>Everything is working now however you will notice that the status bar appears in a funny position. \u00a0Add the following the YOURAPP-Info.plist:<br \/>\n<span style=\"font-size: 13px;\">\u00a0 \u00a0 \u00a0 \u00a0&#8220;Status bar is initially hidden&#8221; -&gt; YES<\/span><\/li>\n<\/ol>\n<p>There you have it. \u00a0Landscape mode locked application with a clean launch image.<\/p>\n<p>Enjoy!<\/p>\n<p>Halsafar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nearing the end of an app development cycle it came time to add a splash screen or in IOS SDK terms the LaunchImage. \u00a0The app in question is to be locked in landscape mode as per request of the client.<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/halsafar.ca\/blog\/2013\/12\/05\/ios-launch-image-for-landscape-only-app-for-iphones\/\">Read more <span class=\"screen-reader-text\">IOS Launch Image For Landscape Only App for iPhone&#8217;s<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,1],"tags":[13,84,22],"class_list":["post-533","post","type-post","status-publish","format-standard","hentry","category-developement","category-halsafar","category-uncategorized","tag-development","tag-ios","tag-linkedin"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":12,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/533\/revisions\/545"}],"wp:attachment":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}