Xcode7 iOS 9 can't make View native size - ios

I have a project. A newly created one. It has LaunchScreen.storyboard. After view is loaded, application each second writes to a console its View Size (self.view.bounds.size).
I started it in iPhone 6 Simulator. Result - 667x375. Why not a native 2x size?
I decided that LaunchScreen is not enough. I set "Launch Images Source" to "LaunchImage" asset, where I put correct Retina HD 5.5 and Retina HD 4.7 screens.
Result - 667x375.
I tried editing info.plist manually and putting "Default-xxxh#2x.png" files in same folder where Info.plist is. Same situation.
I tried setting LaunchScreen to my Main,storyboard. Same situation.
(Same happens with iPhone 5 device which I use for testing - size is always 568x320).
Please help.
I am in despair...

Related

Can I create a auto scale up app using Xcode 7?

Originally I was used Xcode 5 (w/ iphone5) to create an app, and it worked good on Xcode 6 w/ iOS7/8, even on iPhone 6 and 6+, the app will automatically scale up to fit the new screen sizes. Recently I have migrated to Xcode 7 and found there is a black bars on top and bottom, so I follow the suggestions to include main.storyboard as launch screen file, but now the app will not be able to scale it up automatically. I found a discussion about this: Xcode 6 resizes app automatically for iPhone 6 and 6 plus
So I try to create an single view app from scratch (using Xcode 7), delete the Launch Screen File and Launch Image Sources, put something objects on the view, and then remove Auto Layout and Size Classes from main.storyboard, but the app does not expand to fill the new device size for 6+.
Is it possible to do so?
Simple way is Use xcassets, you need to Create a Launch Image Set and add all images with proper size
Create an assets file. File->Create->Resource->Assets Catalog
Select the file, and add New iOS Launch Image
Add an image for each size. Make sure that the resolution of the file has the same aspect ratio as the required file, but the resolution that you want your app to have. E.g. even though it expects 1242 x 2208 for iPhone 5.5, enter 640x1136, and your app will be scaled down to 320x568 with retina autoscaling
You can find out the expected resolution to determine the aspect ratio in the properties inspector at the bottom of the right tab.
Finally, go to your target's configuration under General->App Icons and Launch Images and set your launch image source to LaunchImage (or whatever you called the image).

Is it mandatory to use Launch Screen File to support iPhone 6/6Plus?

I have only Default-568h#2x.png and Default-568h#3x.png in my bundle. When I execute the application in iPhone 6 and 6 Plus the app automatically does some scaling and displays the app utilising full screen size.
But when i use some .xib file as "Launch Screen File", the app stops scaling and does not displays for full screen, has various UI issues.
Is it mandatory to have launch file, if I need to support iOS 8 / iPhone 6 / iPhone Plus?
Is there any chance for the app to get rejected if the app does not use LAUNCH FILE?
Please let me know your comments.
You can use your storyboard for your launch screen now.
http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
NO.
LaunchScreen xib is a quick way to detect main screen.
Depending upon the main screen, OS runs your app and determines screen width and height.
Another approach is just to add launch images for iPhone 6 and 6 Plus instead of LaunchScreen file.
NOTE: Apple is motivating to use LaunchScreen, because it is a one file launch image. It can also be used for pads as well. Single file multi purpose.

not using fullscreen iOS App Xcode 6.0 iphone5s

I have a simple out of box app that doesn't use the entire screen when I deploy it on a iphone5s. By default it creates a LaunchScreen.xib. I have not edited this file on purpose.
Black Bars top and bottom
Other answers suggest to add a Default-568h#2x.png launch image, but I am not using a launch image, and I am not sure where to add these. I see a place for this in the Images.xcassets by clicking the + icon and selecting New Launch Image.
Do I need to add a New Launch Image to Images.xcassets? If so what is the point of having a LaunchScreen.xib?
Thanks!
To get the app to display full screen:
As suggested here (https://stackoverflow.com/a/15328339/4347877), you must include a Default-568h#2x.png launch image (for iOS 7 or earlier). Or if your deployment target is iOS 8 or higher, you have the option of using LaunchScreen.xib.
Why Use LaunchScreen.xib?
For iOS 7 and earlier, app developers had to provide separate launch images for all screen sizes, resolutions and orientations their app supported. For universal apps, up to seven images were required: retina and non-retina versions for 3.5-inch iPhones in portrait and for iPads in portrait and landscape; and another retina image for 4-inch iPhones (the iPhone requires no landscape version because apps are always launched from the portrait-only Home screen).
Creating these images is a nuisance. Xcode 6 comes to the rescue by allowing you to specify a storyboard whose initial view controller will then be used as the app’s launch screen.
If you want to add a launch image instead of using LaunchScreen.xib:
Click on your Images.xcassets folder, right-click in the left pane, and select "New Launch Image." Once you have the correct launch image sizes for all devices you would like to support, drag each image to its respective slot (e.g. "Retina HD 5.5" or "iPhone Portrait 2x"). Before Xcode 6 introduced LaunchScreen.xib I used to create my launch image size here: http://www.appiconsizes.com.
Okay the solution I found came from this question. The answer from James Nick Sears actually fixes my problem. This is after adding the Launch Images. It should be noted that launch images using the images.xcasset is the prefered way to do this pre iOS 8.0 and the only way to make your app compatible with devices running iOS 7 and earlier.
I suggest using TiCons to create the icons, the mapping took me longer then it should have to figure out. In xcode you can see the expected image size for each device by selecting the empty image box and looking in the attribute inspector window on right.
But the real kicker is clicking the 'use asset catalog' button on the "App Icons and Launch Images" of your apps settings under the General tab. Once you click Migrate you can select your LaunchImages from the selection menu that resides where the button used to be, after "Launch Images Source". Without doing this your app won't work correctly on pre iOS 8 devices.

#3x images incorrectly used on iPhone 6 or 5S or 5 in XIB's with the "Use as Launch Image" option set

With-in a clean brand new iOS project I've:
added 2 images to the project "background#2x.png" and "background#3x.png"
added a XIB named "LaunchScreen.xib"
checked the XIB's "Use as Launch Screen" option
added a UIView sub-view to LaunchScreen.xib and set its image name to "background.png"
with-in the project settings, under the targets 'General' settings I've set the 'Launch Screen file' to "LaunchScreen"
Now when I launch the app on any of the devices list below the #3x image is displayed in the resulting launch screen when surely the #2x image should be used.
Problem devices (that all use the #3x resource):
iPhone 5 (iOS 8.0.0)
iPhone 6 (iOS 8.0.0)
iPhone 6 (iOS 8.0.2)
iPhone 5 Simulator (iOS 8.0.0)
iPhone 6 Simulator (iOS 8.0.0)
NOTE that the #2x image is distinctive from the #3x image so I can easily identify which one is being used.
At first I assumed this was a bug with the simulator and was staggered when it occurred on a real device also.
I assume this is yet another iOS8 bug however I guess there's also the possibility that its expected behaviour as the result of the launch screen being cached as a static image of some kind.
Any ideas or potential solutions?
EDIT:
For the benefit of others, I have subsequently found that if the images are instead added to an Images.xcassets image set then the correct behaviour is in-fact observed. HOWEVER this is not an ideal solution for us since we have a very specific image export process which means we are not using an Images.xcassets in out project (there are thousands of images in the app).
I have now also raised a Radar with Apple #18513968
http://openradar.appspot.com/18513968
I've just tried this myself, and get the same behaviour you have mentioned.
By setting the Launch Images Source to "Use Asset Catalog", and adding the Launch Image you can get each device to show its specific background. Some screenshots can be seen here:
Supporting iPhone 6 and iPhone 6+ with different launch/splash screen image for iPad Portrait and Landscape orientations
Looking into it a bit more, I found a website that mention:
http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
"You can use the new adaptive UI features in Interface Builder to fit your layout to different screen sizes. If your scene requires screen-size-specific images, use asset catalogs to define different images per size class."
Maybe that is the only way to do it.

Simulator running in scaling mode for iPhone 6 Plus?

My app starts and runs on the new iPhone 6 Plus (or iPhone 6) in the simulator, but elements that I know are supposed to be small on the big screen (i.e. hard coded CGRects) are large, as if the whole app had just been scaled up for the larger screen.
How can I get out of scaling mode in the simulator?
It looks like setting a launch screen file in the "App Icons and Launch Images" section of your project settings, or adding iOS 8 images to your launch image catalog, will enable "native" resolution.
Adding a correctly sized LaunchImage seems to be enough (setting an incorrectly sized image won't).
Also adding the new "Launch Screen File" should work:
You must set correctly sized LaunchImages
For more information about LaunchImages and icons see this documentation
https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
use Asset Catalog Creator from mac app store.
https://itunes.apple.com/gb/app/asset-catalog-creator-app/id809625456?mt=12
give it any image and it will generate all the correct launch images and icons in a xassets file.
This should stop the scaling of the whole app on iphone 6+

Resources