How to deal with Xcode update to recommend settings warning? - ios

Recently, I upgraded to Xcode 6. Anything works well except I got a new warning indicates me to upgrade iOS Deployment Target to 8.0. Bellow is a screen shot of the message.
However, I don't want to upgrade deployment target because I want to support any device that has OS version 7.0 and above.
How to ignore this warning? Or perhaps iOS Deployment Target setting has nothing to do with the lowest OS version that my app can support?

I think there is a bit of confusion here, there is a difference between the Base SDK setting and the Deployment Target. Deployment target determines which versions of iOS you support, the SDK version simply determines which version of the SDK you are using to write your code. As long as you don't use any code which requires iOS 8 (Or if you want to use it check that it is available: Checking For Class Availability). So to fix this, you should click Perform Changes. You will still be able to run your app on iOS 7 :)

Related

Does user's iOS version limit their ability to install an app from the app store, is there a way to make it universal? [duplicate]

I wanted to ask how compatibility on different iOS operation systems works in iOS. For example If I develop an app on Xcode 9.2 and Swift 4 for iOS 11, should it work on iOS 9?
I am coming from Android background which you specify the minimum Android OS that is needed for the app to run in the Gradle file. Does anything similar exist on iOS?
Very simple solution:
Set deployment target as 9.0 in your build target general settings. iOS will automatically handle support from 9.0 onwards for a build (your app).
Your app/build will be allowed to use/import frameworks and other libraries, compatible to minimum deployment target, only.
More detail about App Deployment Target from Apple.
Please set your deployment target to 9.0
Yes, it will work on iOS9
With Xcode 9.2 and swift4 you can develop an application for ios8.0 and above.
In your project setting, you have to select your development target
Yes, there is backward compatibility, but for older iOSes you have to check version when using newer API. Luckily we've got availability attributes (#available)
If you want to know HOW it works, basically for Swift your application has its own swift standard library embedded into binary of your application. In case of Objective C – newer iOSes keep sdk's of older versions to maintain backward compatibility.

Swift Update supported ios version

I have project with iOS Deployment Target 8.0 but I want update to iOS to support devices iOS 10 - 11.3
How to do it right
im need to change Deployment Target and it will work?
I can't find an answer to this problem
How can i do this? Thanks
If you wish to support iOS 11.3 you need to upgrade to Xcode 9.3.
That will include Swift 4.1 so you may get a lot of new warnings and errors in your Swift code depending on what version you are currently using.
Your project's Deployment Target has nothing to do with any of this. The Deployment Target defines the oldest version of iOS your app supports. If you keep your Deployment Target at iOS 8.0 (or anything earlier than the latest version of iOS) then you need to make sure that your code properly ensures that newer APIs are not used on older devices.

Why isn't Xcode (Swift 3) flagging APIs from iOS 10+ when deployment target is 9.3?

The title covers it. Latest Xcode and using Swift 3. I'm probably using some stuff from 10+, but no messages, and then crashes on an iOS 9.3.5 system. My understanding is that the compiler would flag any APIs that weren't appropriate for the deployment target. Is there a setting I missed? Am I wrong in believing the compiler will flag offending APIs?
Most other questions about deployment targets seem to be pre-Swift 2, and the later ones seem to say they should be flagged.
Thank you.
I think Xcode swift compiler will only flag when you build against the selected iOS version. Try downloading iOS Simulator 9.3 and then select it and build. Deployment target doesn't cause any warning unless the current iOS version selected in the dropdown during build time doesn't support an API.

Methods from new iOS-version, not giving warning, dispite of older SDK

I have a basic question about the difference between the "deployment target" and iOS version availability. By example:
In my project I use this line of code:
I Xcode i setup the project like this:
and it matches the deployment info under the specific target as well.
When I run this code, it works.! But why?
How come I don't get any warnings?
My deployment target is lower than the availability for that specific line. Why dosn't the compiler give me an error here? I'm testing the code on my iPhone with iOS 9.1 installed, is that why? The same thing happends when I run it on the simulator, also with iOS 9.1
EDIT:
After reading through the App Distribution Guide and SDK Compatibility Guide, I still dont get, why I'm allowed to run "MKMapSize"-method, when my base SDK is set to iOS 8.0, whitout getting any warnings? See image from target settings -> build settings:
EDIT 2:
I found an example of a new method that does give med the error I'm asking for:
Why does this method give me an error, when the 8.1 method doesn't give me an error?
EDIT 3:
So if I go along and uploads this project to the app store, will the app work for users running iOS 8.0? or will it crash when MKMapSize (which is available in iOS 8.1 and later) is executed?
MKMapSize was added in iOS 4 according to the documentation:
Availability Available in iOS 4.0 and later.
I too have noticed that the mouseover popup "lies" regarding the availability. It seems to use the version you're targeting and not the actual availability specified in the code, if the actual availability version is lower than your deployment target.
It's either a bug, or it might be because iOS 8.1 is the earliest SDK you have installed on your machine.

targeting iOS5 - will it work on iOS6 also?

Hello I am beginner with these things and would appreciate nice explanations
that would dismiss my doubts.
If I target my app for iOS 5 -- does it mean users who have iOS 6 and iOS 7 can
also use it? Anything I should watch out for?
There are two primary settings used for your targeting your builds:
Base SDK & Deployment Target.
The Base SDK = What are the latest features I want available in this app?
The Deployment Target = What is the earliest OS I want to be able to run this app?
So, if you have both of these set to iOS 6, the user must have iOS 6 to install or run the app.
If you have a Deployment Target of iOS 5.0 and a Base SDK of 6.0 that means it'll install and run in iOS 5.0, but you need to be careful to branch your code and not use any iOS 6.0 features if the user is running on an iOS 5.0 device.
Yes, the target is the minimum version version that the app can run on. That doesn't mean that the app will work properly on newer versions and you really need to test to be sure. If you're creating a new app think carefully about which older versions to support.
If you target your Application for a lower iOS version, anyone with the version number you target AND HIGHER and access the application. Anyone LOWER than the one you target will not be able to download and use the application.
Everything will work fine, however there are certain features that are only available in iOS6 and iOS7 such as UICollectionView is only available in iOS6 and above. Fortunately you can test the different OS's in the simulator, it will make you life easier and you will be able to see if your application breaks running a different OS.

Resources