How can you detect a third generation iPad 12.9 from previous versions - ipad

I need to programatically detect the new iPad pro 12.9 inch model in my code and change my interface appropriately. As both the new 12.9 iPads and the old models have the same screen size one can not use that technique to determine which model the app is running on.
Any Suggestions.
Thanks
Reza
Answer:
For anybody else that might be interested, you need to look at the:
ViewController.view.safeAreaInsets
the bottom value for the inset is set to 20 for the third generation iPads.

Related

Updated launch image naming convention for all devices

All the resources I have gone through are quite old and don't provide the complete set of names for a launch image. Like this.
I am aware that launch image set take care of that, but while using it for a full screen UIImageView, it doesn't work. So I am going by the old way.
This is Apple's link for the list of devices and their resolutions. Screenshot :
I have managed to get most of the names other than :
iPad Pro 10.5 inch
iPad Pro 12.9 inch
iPad Pro 12.9 inch 2nd generation

iOS auto layout support for all iphones?

I'm using autolayout storyboards for my ios app which is only for iPhone. When I submit, Apple reject it saying that the app should support iPhone 3.5 inch for ipad view on iphone resolution but making the UI for iPhone 3.5 inch is bit hard.
If I change it to support iPhone 3.5 inch onwards it gives bad view for iphone 5 inch. The contents are not centric there's long space for iphone 5 inch. What are the solutions?
Can I configure the settings to support iPhone 4 onwards?
or else Can I make two storyboards for iPhone 3.5 inch & 5 inches?
Yes, you can make 2 storyboards and switch them, depending on screen height, but why you can't adjust constraints for all iPhones screens? Usually this is possible.
One way for complex layouts - create constraint outlets and change them in code.
Another way - divide design to smaller UIViews, that contains elements, like container and set constraints between them.

Xcode 6: Storyboards

I loved Xcode 4 when there was two storyboards, one for the iPhone and one for the iPad. There was only one screen size to which was the 3.5 inch which made the layout so much easier. Then Xcode 5 came along and it was different because the iPhone storyboard layout changed for the 3.5 inch screen and the 4 inch screen and it was quite difficult to use. Now Xcode 6 is here and I now only have one Storyboard. I hate it. I cannot get any of my iPhones buttons and labels to line up at all. iPhone 4 inch and 4.7 is fine, but the 3.5 is all off. I have tried all those tricks of resetting the suggested constraints too. So my question is, is there any way to have more than one storyboard? I would really like to have one for the iPhone 3.5 inch, another for the iPhone 4.0 inch, another for the 4.7 inch, one for the 5.5 inch and one for the iPad. I would also like them to all work fine and not interfere with each other and there layout. I am not worried if I have to do everything about 5 times but I would rater spend more time and get the layout correct. So if this is possible I would be extremely happy!
You could try loading the storyboard in your AppDelegate.
Described here: https://stackoverflow.com/a/12553838/866904
Create 2 storyboards and then just load the preferred one in your AppDelegate.

How to create the UI for different devices in iOS? [duplicate]

This question already has an answer here:
Xcode5 ( 3.5" screen to 4 inch )
(1 answer)
Closed 8 years ago.
I'm working with an iOS application in which i uses the different controllers with 4 inch screen sizes.
I'm done with my application. Now it is the requirement that it also runs on the 3.5 inch screen like on iPhone 4S. I am using the auto layout. How can i do it?
This is my first application.So I have a little knowledge about UI.
My requirement is that when I run the same application on iPhone 4S with 3.5 inch screen size, it needs to be reset automatically with 3.5 inch.
Please help me out.
Use the iOS Simulator, that will give you an idea of how the application will turn out (Whilst you're in in choose Hardware -> Device -> iPhone Retina (3.5 inch).
You can adjust elements in interface builder to scale to different elements on the screen under the view tab. Try using the view tab (looks like a ruler) and specify the origin and scaling there.

Modifying an existing 4-inch storyboard to work on a 3.5-inch screen [duplicate]

This question already has answers here:
Supporting Multiple Screen Sizes in Storyboards (3.5 and 4 inch screens)
(2 answers)
Closed 9 years ago.
I am programming an application (my first) for iOS 7 using Xcode 5.0.2, and I think I may have made a mistake in designing the story boards on the 4-inch display first, because I want my application to work on both the 3.5 and 4-inch display.
Do I have to create a new story board for the 3.5 inch, or can I use auto layout to configure what I already have? If I can, how do I configure it? I've used auto layout before, but not to support different screen sizes, only for changing from portrait to landscape.
If I have to create a new storyboard, do I have to create new classes for those or can I somehow link to the code I've written?
Autolayout is designed for just this sort of thing. If you have set it up for changing between portrait and landscape, it should Just Work when changing between 3.5 and 4 inches. If not, please post a more specific question!
If you are using storyboard, as #hatfinch mentioned it will work out of the box. You might have to go modify your constraints to make sure it look okay on 3.5 inch screen.
You can see how your views will look like in 3.5 inch by following ::
Select your storyboard.
From Editor menu, select " Apply Retina 3.5-inch Form Factor".

Resources