Storyboard size on iPhone6 after update - ios

I take a old app with a 3 storyboard inside:
iPhone4 || iPhone5 || iPad
at the moment from the AppStore this working well on iPhone6 and 6Plus even if not have iPhone6.storyboard inside show in full screen correct position, but now during the test on iPhone6 (device not simulator) is showing a 4.0 inches inside a big display of 4.7 inches, here the screen:
I Know is better using a new system with Auto Resize and Size Classes but at the moment we don't have time to do a refactor.
So this is my question, is possibile reuse my iPhone5.storyboard as before to see all stuff inside in a correct position, neve use Auto Layout and Size Classes?

It may be possible, by not using a launch image .xib file. In that case, your app appears zoomed on the iPhone 6. That is why your existing app looks okay on iPhone 6: it doesn't have a launch image .xib file. So you could solve the issue by deleting the launch image .xib file and telling the app to use old-fashioned launch images instead.
But that, as you rightly say, is not really correct behavior; eventually, Apple will probably forbid it.

Related

Removing launch screen file from Info.plist scales the views

I noticed something that when you remove the launch screen file entry from the XCode Info.plist file, any view of any view controller becomes scaled according to the screen size, so the views appear zoomed in on large screen sizes such as the iPad Pro (12.9 inches) and appear somehow zoomed out on smaller devices (iPad Pro 9.7 inches).
In that case it seems that the Auto Layout constraints have no effect as the scaling is done automatically.
I really can't understand what does this has to do with the layout constraints, so I appreciate if any one can explain what's the reason for that.
Without being able to provide deep details, iOS uses the launch screen definition (view or static images) to determine which size classes the app should use. If you have not supplied those, it seems you get scaling that you generally do not want.
That doesn't mean auto-layout no longer has any affect... it just means that the auto-layout engine is not using the current screen size for its size/positioning calculations.
You'll see very similar results if you explicitly set your project for iPhone only.
Simple, obvious solution: Don't remove the launch screen.
Yes this is expected behaviour... Same is for iPhone 6 Plus. If you remove the iPhone 6 Plus launch screen, it will display the iPhone 6 scaled version.
This is just for backward compatibility. If your app is not ready for iPad Pro or iPhone 6+, scaled version can be used by removing the respective splashing screens.
All current iPhone apps or iPad apps in AppStore those are not optimised runs as a scaled version.

Adding a Launch Screen changes the display of my whole app

I tried adding a launch screen to my app. I tried the simplest : just add a new file of type Launch screen to my project (and do nothing more). But this seems to change the resolution of my whole application. Here are sample screens of the same controller of my application with and without the Launch Screen :
without the launch screen :
with the launch screen :
Strangely, once I have used the Launch Screen once, I need to quit and re-launch the simulator to re-obtain the original resolution.
What should I do and which resolution is the correct one to work with ? Does it have something to do with retina ?
I can copy-paste the code generated in the LaunchScreen.xib if needed.
From Apple's documentation:
You use a launch XIB or storyboard file to indicate that your app runs
on iPhone 6 Plus or iPhone 6.
By adding a launch screen you activated native support for iPhone 6 and iPhone 6 Plus. That means that your app is no longer scaled up to adapt the larger screens of the iPhone 6 and 6 Plus, but uses the full resolution of those larger screens (which IMHO is a good thing that you should do).

Views in storyboard do not resize properly on iPhone 6

I've checked a lot of different websites and stackoverflow answers, and I'm still stuck.
I developed an app for iPhone and iPad targeting iOS 7.1. I have two storyboards, one for each device. The app only displays in portrait mode. I cannot seem to get the app to display full screen on the iPhone 6 simulator.
I've tried numerous things, I followed the advice linked here by adding a Launch Screen, setting the iPhone storyboard to auto layout and "use size classes", and . Not only does that not affect the size, but the Launch Screen doesn't seem to scale properly either. If I get it to fit the iPhone 6 it doesn't fit the iPhone 5 properly.
I've tried adding the proper launch images and I don't get any errors saying the wrong image resolution is present.
I've used the storyboard as a Launch Screen described here.
Now, when I switched to "use size classes" I could manually extend the objects in the views to match up with the size of iPhone 6 (I have not tested it for 6s) but that makes it extend past the iPhone 5 boundaries. The only thing I can think of right now is to create another storyboard and detect if it's iPhone 6, but I would really like some other ideas.
Here's what it looks like for iPhone 6:
And here's what it looks like on iPhone 5:
Best advice i can give u is
Use default size class , the classic 600x600 and then use Auto Layout
Or do the reverse, take a 3.5inch size VC and apply Auto Layout on it. Everything will present itself quite perfectly if you can apply the right constraints
Here is a link for an awesome Autolayout tutorial

Where to put launch images?

This has been an amazingly exasperating and non-transparent process.
So far, from this question I have figured out the different dimensions of launch images I needed and that I can safely not use launch xibs / storyboards if I already have the launch images, and from various posts I have determined that the naming convention (APPARENTLY??) should be Default#2x.png for iPhone 4s, Default-568h#2x.png for iPhone 5, Default-667h#2x.png for iPhone 6, and Default-Portrait#3x.png for iPhone 6+, although I have seen conflicting information on this so I'm not even sure....do I need ~iphone appended to the names?
BUT THEN, I go to add them to xcode so I go to my images.xcassets thing and select "new launch image" and this chart thing appears that makes zero sense to me....it only has space for one landscape picture, "Retina HD 5.5", but not for the other landscapes....even though the project is supposed to be portrait-only anyway...and if this thing is keeping track of my images then what do I need the naming convention for? This is so confusing.
Okay, the easiest way to make a nice launch image is to use a xib. You won't have to worry about naming conventions and it will scale beautifully across all your devices.
Step 1:
Your project should come with a file called LaunchScreen.xib. If you don't see one like that, hit File > new File > User Interface > Launch Image.
Step 2:
Open the xib and click on edge of the xib. Then, click on the Attributes inspector. Set the size to whatever you are using in the rest of your app. We are taking advantage of the auto layout and so the image should be resized to fit other devices.
Step 3:
Drag in an image view and resize it to fill the xib. Insert a high resolution version of your splash screen.

iPhone 6 - app does not fill screen

Most of my apps scale up when run on an iPhone 6, but for some reason one of my apps looks like this:
What would cause it to not just scale up and fill the screen?
EDIT: Here are some repro steps:
Create a new project (Single View). Turn off size classes and just use iPhone.
Make the background orange.
Add a yellow UIView subview at (20,20,280,200).
In Xcode you get this:
Now simulate on iPhone 6. You get this:
Why doesn't it just scale up and look normal?
Not sure why this is getting downvoted. It's a legitimate question. And here's the legitimate answer:
Remove the "Launch Screen File" in Projects > General. Xcode 5 did not have this so older apps scale up automatically. Apps created with Xcode 6 get a default Launch Screen file created.
Removing it will make your app scale up on iPhone 6.
I have got the same problem and I managed to solve it by adding constraints to my ViewController in the storyboard.
Make sure that you clicked the ViewController of your scene. They yellow button in the this screenshot.
Click Editor-> Resolve Auto Layout issues -> Add Missing Constraints
Now you will find that the background image is scaled up to fill iPhone 6 or iPhone 6 plus.
Note that this solution works for me even if I did not provide any launch screen file.
I had the same issue. Searching for an answer, most of them mention the launch image. To me, what did the trick, was that I first enabled launch image for iOS8.0 and later in Xcode, which requires the native resolution sizes for 4.7" and 5.5". Adding these sizes didn't help, but when I re-disabled them, it started working!
If you do have any launch image, you will need launch images for all appropriate sizes. I was doing a minor update to an app, and it was not showing correctly on the iPhone 6 simulator. I created four launch images (.png files). Since the app should still run on iOS 7, I apparently could not use an asset catalog. I gave the images the correct names, and all is good.
Image sizes and names may be found here:
Sizes and Naming of Launch Image for iPhone app in iOS8

Resources