What is the minimum deployment target for using UISplitViewController on iPhone? - ios

When the iPhone 6+ came out UISplitViewController was still restricted to iPad devices, so I rolled my own simplified split view controller for use in iPhone 6+. Consulting the current documentation it seems that the restriction has gone and that UISplitViewController is now available on iPhone, so naturally I am considering to switch to UISplitViewController.
I haven't actively tracked the history of UISplitViewController, though, and I haven't been able to find out with a few internet searches in which iOS version the restriction went away. This information is important to me because my app should still support devices with older iOS versions installed. Currently the app's deployment target is set to iOS 9.
So what is the minimum deployment target I have to set in my app if I want to use UISplitViewController on iPhone? Is iOS 9 sufficient?

The UISplitViewController is available on iPhone since iOS8, so iOS9 is sufficient.

Related

Submit iOS app for specific devices

I'm trying to build an app and tried to make it only support iPhone6, iPhone6 Plus but when submitted the app to App Store. They rejected it because it was crashing on iPad. How can I remove the iPad support and the other devices as well. In Xcode in Deployment Info, [Devices] is set to [iPhone].
EDIT:
My app uses M8 chip that's why I want to limit it to iPhone6, iPhone6 Plus only. As for the iPad I can't offer support it now because I can't maintain testing it and keep updating its design every time I update my app.
EDIT2:
In Xcode in Deployment Info, [Deployment Target] is set to [8.1].
You have to change the Targeted device family. Select the project, then info-->Deployment--->Targeted device family to iPhone only and you have to do the same thing in targets. After that your app will be only for iPhone.
Good Luck!
There is no way yet to set app only for iPhone 6/6+, however you can prevent running it on iPad by setting the correct title. You can't prevent running your own app on iPhone 5 till you have allowed it to run on iPhone 6/6+. iPhone, iPad or both, no versions.
I don't think you can choose which kinds of devices you are supporting for. But, you can choose minimum iOS version that your app supports in the Deployment Target. I think your solution will be changing the Deployment Target to iOS 8.0 and you are good to go.
For your problem of rejection, you can change your supported iDevice to support iPhone only from your app target in XCode. Then on the General tab, you can change it from the Deployment Target portion.

how to deploy and debug an iOS app on iPhone 4 using Xcode 6

I have an app which is crashing on iPhone 4 having 7.1 installed , i want to debug app on phone using xcode 6, is it possible(as it shows unavailable currently) ? if not what are the options I am left with ?
There is no option for an "iPhone 4 Simulator" in Xcode 6. But, if you use an iPhone 4S simulator with iOS 7.1, you can achieve the same effect, because with the same screen size and OS they are essentially the same for testing on the simulator. Also see this question for reference.
Of course, if you have a physical iPhone 4, you can also test on the actual device. Make sure that your Deployment Target under TARGETS AND the iOS Deployment Target under PROJECT are set to 7.1 or below. Your Base SDK can be set higher, but this means you will have to make sure that you are either not using features or classes that are unavailable in earlier versions of iOS, or do a version check and adapt your program accordingly. For example, UIAlertController was introduced in iOS 8, and will crash a device below that if it is invoked. So you might want to do a version check and use good old UIAlertView if the iOS device version is below 8. An issue like this is the most probable cause of your crash.
Also, if it's the first time you're using this device for development, don't forget to set it up by going to Window -> Devices, selecting your connected device, and pressing Use for development.
If you don't have the iOS 7.1 SDK and don't see it as a iPhone 4S (7.1) in the simulator selection, you need to download it by going to Preferences -> Downloads.

My empty swift app crashes on xcode6-beta with deployment target 7.1

My objective is to verify that swift apps/code can run on iOS 7 simulators
I am following this question Do Swift-based applications work on OS X 10.9/iOS 7 and lower?
and specifically this answer -by #Anil https://stackoverflow.com/a/24038997
The following are the steps I followed
Installed xcode6 beta
Installed iOS 7.1 simulator from Xcode6->Preferences->Downloads
Now, I created a new iOS Application Master Detail project and selected swift as language
With default settings I was able to run the app
Now I changed the simulator to iPhone 5- 7.1 by following this -https://stackoverflow.com/a/24038727 and changing the deployment target to 7.1.
Now I can see my iOS 7.1 simulators
When i try to run it I get build succeeded but the app crashes with swift dynamic cast excption
libswift_stdlib_core.dylib`swift_dynamicCast:
The Master-Detail Xcode project template creates a storyboard with a UISplitViewController as the root view controller.
Before iOS 8, UISplitViewController was iPad only. The documentation states:
In iOS 8 and later, you can use the UISplitViewController class on all
iOS devices; in previous versions of iOS, the class is available only
on iPad.
You might want to load a different storyboard for devices running an older version of iOS. I've been wondering how apple wants us to approach this with iOS 8. It might be a good idea to read up on what Apple calls Adaptive View Controllers, or watch a WWDC video on them. I believe "Building Adaptive Apps with UIKit" covers the new functionality of UISplitViewController

Why does autorotation happen in iOS 6 but not iOS 5?

I have a general question to iOS 6 and AutoLayout in the Simulator.
My app is targeting iOS 5 and iOS 6 as well. I need to switch-off AutoLayout in StoryBoard otherwise the app is crashing in the iOS 5 simulator (since AutoLayout is supported first with iOS6).
But when I start the iOS 6 simulator all views are rotating and all subviews are resizing accordingly. Using iOS 5 simulator all views doesn't rotate with changing the device orientation.
Would that happen on real devices as well? So, even with switched-off AutoLayout option in Storyboard would all the views rotate with the device orientation with iOS 6 and better on a real device?
Thanks!
Apple changed how autorotation works in iOS 6.
If you create a project in Xcode 4.6, Xcode sets it up to use the iOS 6 autorotation API. The project template allows portrait, landscape-left, and landscape-right orientations (and upside-down portrait in an iPad app). So when you run the app on iOS 6 (device or simulator), the app allows interface rotation.
When you run that project on iOS 5 (on either the simulator or the device), the system ignores the iOS 6 autorotation API and looks for the shouldAutorotateToInterfaceOrientation: method on your view controller. Since Xcode 4.6 didn't create that method (and presumably you didn't add it), the system uses the default implementation, which is only returns YES for portrait orientation. Thus on iOS 5 you don't get any interface rotation.
The simple solution, if you don't want interface rotation, is to go to your target's Summary and turn off the landscape orientations.
You can learn more from several official sources:
The “ Handling View Rotations” section of the UIViewController Class Reference.
The “UIKit” section of the iOS 6.0 Release Notes.
“The Evolution of View Controllers on iOS” video from WWDC 2012.
Like #Patrick Tescher said, you can't use Auto Layout in iOS 5.
You should also consider the fact that only 6% of the users have iOS 5, as of June '13. At the same time, iOS 6 adoption is at 93% (source). This is a very high number. So depending on your situation, perhaps you don't have to make your app iOS 5 compatible in the first place. Spending twice the development time on a feature to make it work for 6% users may not be the best use of one's time. Unless it's a business decision and you get paid in either case :)
If you want to support iOS 5 you should not use auto layout. Auto layout is only supported in iOS 6 and later.
You can technically have two storyboards and load one for iOS 5 and one for iOS 6 but you would be duplicating a lot of work. Best to just hold back on Auto Layout until you can remove iOS 5 support.

Can an application that uses a storyboard be deployed in an iPhone not running on iOS 5

The storyboard is a very powerful and easier way to build iOS apps. But I just want to know if apps made using them will work on iOS earlier than 5.0. For example, will it work on iPhone original or iPhone 3G
If it will not, to be able to run it on all iOS versions, do I just use the old method (I mean nibs and programmatically creating MVC)?
Short answer is: no.
Storyboard is a iOS 5 or later technology. It will work on any device running iOS5. Apps using UIStoryboard will not work on iOS 4 or iOS 3.
You should think of it in terms of iOS versions and not physical devices, although, obviously, any device not capable of running iOS 5 won't be able to use UIStoryboard, either.

Resources