Hi there. I've just recalled time when Xcode 13 was released and latter version of UIKit contained a bug with UINavigationBar API.
I was expecting that bug will be noticed as soon newer iOS will be released. As UIKit linked as dylib and system theoretically should contain single version of system library.
I updated my phone to newer iOS, downloaded app built with Xcode 12, and fortunately didn't face bug.
Once we updated to Xcode 13 we noticed the bug immediately.
The answer is:
Does apps built with older version of Xcode shipped with older versions of SDK?
If so do they bundled inside app package?
Changes in behavior in Apple's system frameworks are often gated behind the version of Xcode used to build. So if you build with Xcode 12 you get the older behavior even on newer systems. Once you build with Xcode 13, the newer behavior is unlocked and you may see the bug you're fearing to. Nothing is bundled, it's just a dynamic check in the SDK on device.
You have an app built with the iOS 16 SDK (Xcode 14) and run it on iOS 17. The iOS 17 frameworks see, at runtime, that your app was build with the older version, and so run the older implementations of some features or behaviors. Not all features or behaviors are dynamic like this. Once your rebuild the app with the iOS 17 SDK and Xcode 15, the iOS 17 frameworks see that and use only the latest behavior. You app doesn't include anything new, it's just a value stored in your binary that is checked to see what versions of things were used to compile it.
It sounds like introspection of mach-o, or not? Or there is some builtin support for this within swift runtime?
And btw are there any references to take a look at this mechanic or may be it has some common name?