I created a static library that has a Deployment Target of iOS 10.2. The library is integrated in an app that has a Deployment target of 9.0.
Somehow the app builds and runs fine on iOS 9.0. Why is that? Should the app build even though the library only targets iOS 10.2 and above?
Yes, Your build will compile without error if your app's Base sdk is equal or higher than Deployment target of static library.
Static Library internally is bunch of complied object. after your app compiles,at the time of linking, it checks for availability of symbols used in static library. and if your project's base sdk is equal or higher than Static library's deployment target, your project will find definition of all the symbols used in library -So No compiler error.
At runtime, you may get error if you use your app on device with ios version lower than static library's deployment target and have used symbols not available in that version.
If your code/library's uses a symbol:
Defined in the deployment target, your code links and builds normally. At run time:
Source: developer.apple.com
here is Image from above link, explaining what symbols you can use depending on deployment target and base sdk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With