{"id":26,"date":"2012-10-05T16:42:49","date_gmt":"2012-10-05T16:42:49","guid":{"rendered":"http:\/\/dev.vunet.us\/?p=26"},"modified":"2012-10-05T16:51:53","modified_gmt":"2012-10-05T16:51:53","slug":"convert-your-app-to-iphone-5-resolution-with-4-inch-tall-screen","status":"publish","type":"post","link":"https:\/\/dev.vunet.us\/index.php\/iphone-development\/convert-your-app-to-iphone-5-resolution-with-4-inch-tall-screen\/","title":{"rendered":"Convert Your App to iPhone 5 Resolution with 4-inch Tall Screen"},"content":{"rendered":"<p>In iOS 6 Apple made it easy to convert your iPhone app to new 4-inch tall screen size. In XCode, select .xib or .storyboard file of your app, for example, MainWindow.xib or MainStoryboard_iPhone.storyboard, and go to File Inspector. Find &#8220;Use Autolayout&#8221; checkbox and check it. This will adjust all views according to screen size. Secondly, supply a larger default splash image of the new size 640 px by 1136 px and name it Default-568h@2x.png.<\/p>\n<p>Within your app you can actually detect whether it is iPhone 5 or not and use the appropriate splash screen image. Use this code to detect iPhone 5:<\/p>\n<pre><code>#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) &lt; DBL_EPSILON ) <\/code><\/pre>\n<p>and later in your app delegate<\/p>\n<pre><code>splashImage = (IS_IPHONE_5) ? @\"Default-568h@2x.png\" : @\"<code>Default.png<\/code>\"; <\/code><\/pre>\n<p>The splash image will tell iOS what resolution you use. Possibly you need to adjust some fixed size views if any. But all my apps worked with new resolution correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In iOS 6 Apple made it easy to convert your iPhone app to new 4-inch tall screen size. In XCode, select .xib or .storyboard file of your app, for example, MainWindow.xib or<\/p>\n<a class=\"moretag noptoppad\" href=\"https:\/\/dev.vunet.us\/index.php\/iphone-development\/convert-your-app-to-iphone-5-resolution-with-4-inch-tall-screen\/\">Read More...<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-iphone-development"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":3,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/posts\/26\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.vunet.us\/index.php\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}