How does an application with a lower base sdk work?

In Xcode, I can specify the Base SDK. I wonder how it works behind the scenes? If I run the application, for example, on a device with iOS 7, and the base SDK is iOS 6, then how did it turn out that the application has the old "appearance"? Does Xcode collect the old SDK and include it in my application or does the new iOS version make older libraries / SDKs?

In other words, does the runtime of this application know compiled with a lower base SDK and somewhere in the UIKit code it does:

if (lower SDK) { //show old look/feel } else { //show new look/feel } 

or does the application itself include the old library and load it?

thanks

+6
source share
7 answers

IOS apps are compatible with Outlook with newer versions of iOS. The reason is that:

Almost all changes in iOS versions are additive and, therefore, building the application using the lower version still works on the higher iOS version.

Although we need to take care of this:

As part of the evolution of various releases, APIs are introduced or deprecated, and the behavior of existing APIs can sometimes change. Apple is working hard to minimize changes that may cause incompatibilities, in some cases providing alternative framework-based behavior. In rare cases, your code must determine the framework version and adjust accordingly

To understand more, read this.

+3
source

You must set your goal on ios 5.0 (through the project’s target settings) to make sure that none of the ios6 methods are used (otherwise a compilation error will not allow you to create it).

To support new features and check ios6 availability on your device, you have two ways:

At compile time (so you can still build your application with lower goals and newer together) use the following macro

 #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0 // Your ios6 code goes here #endif 2: During runtime : [[[UIDevice currentDevice] systemVersion] floatValue] > 6.0 
+2
source

Apple never modifies / deletes / renames classes or methods. They add only new ones.
If they no longer want to use it, they mark it as deprecated .

This is a very important point.
At compile time, the compiler checks to see if all classes and method signatures with which your application is built are available in the SDK.

In this case, you can create and deploy your application. Since these classes and methods will never be removed from newer versions of the framework, your application will work fine.


Alternatively, you can create applications and deploy them on systems that do not actually support the current SDK. For example, you can use Autolayout ( NSLayoutConstraint class is available from 10.7) and deploy it for Mac OS X 10.6. The compiler will not say a word.

The application will be divided into systems up to 10.7.

+2
source

Your project is built against the current SDK. If you have an older deployment target, then your code base has been compiled against this. Therefore, if you create against 7.0, but have a 6.0 deployment target, iOS 7 will not initiate certain deviations. Everything will be compiled against the oldest deployment target.

However, this will put pressure on you as a developer to make sure that you are not using special iOS 7 code. The compiler still assumes that you mean to allow newer users to run your application, as well as all the latest methods available to you and your users the latest version. You can either check your code base on the old SDK for older devices, or on Simulators to make sure it works well, or use an application like Deploymate that will check the methods you use that may cause problems.

If you plan to use any of the latter methods, you will need to verify them in an if compiler expression (for example, Peter Fidemraizer) or in normal cases if there are statements checking the version within Foundation.

 if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { // Load resources for iOS 6.1 or earlier } else { // Load resources for iOS 7 or later } 
+1
source

Base SDK means that the SDK will be built on your application. The SDK has some frameworks, etc., which differ as the version of the SDK changes. For instance:

Say your current base SDK in your Xcode is iOS 6:

  • You may have the frameworks and features that the iOS 6 SDK provided to you.

  • Your application will be used in any iOS SDK that you specify as the “Minimum iOS SDK”. The minimal iOS device gives you some restrictions on the components used. Remember this.

  • Your application will be available in iOS 7, just as it works in iOS 5 or iOS 6. Because iOS versions are backward compatible. This means that iOS 7 will launch applications running on iOS 6.

Say your current base SDK is iOS 6 and you want to make it iOS 7

  • Your application will be created with a new SDK, so if the new SDK has some big changes in it, you will immediately see the differences, you will start the application. For example, in the iOS 7 SDK, you can use the status bar (20 pixels). This can ruin your view hierarchy.

  • You need to test your application again to check if your code is compatible with iOS 7

  • If you want to use the new frameworks or features of iOS 7, you are in the correct order, you can use them now :)

In short, the Base iOS SDK is on the version of iOS in which your application is compiled and built. run it on iOS X? device is another concept.

Hope this helps

+1
source

The Base SDK is the SDK that you want to use to create the application. Use the "Deployment Goal" to specify the minimum OS you want your application to run on.

If you want to know the version of iOS, check this question .

0
source

When updating the Apple frameworks themselves, Apple takes care of supporting multiple versions of iOS, however you need to perform some basic checks, which are explained here

0
source

Source: https://habr.com/ru/post/953673/


All Articles