I have added an iOS 15+
function to my app and now it is crashing on my M1 iMac running in iPad Mac Catalyst mode on macOS 11.6. Could this be a potential bug in macOS, Xcode or Swift?
I have this code:
if #available(iOS 15.0, macCatalyst 15.0, *) {
dataSource.applySnapshotUsingReloadData(fullSnapshot, completion: nil)
} else {
dataSource.apply(fullSnapshot, animatingDifferences: false)
}
When I run it on my mac, I can see it is running thinking it is iOS 14.7
using print(UIDevice.current.systemVersion)
however it runs the code within the available
check and crashes because it is not available on my macOS version yet!
I have tried using this code too:
#if targetEnvironment(macCatalyst)
print("HERE")
#else
print("HERE2")
#endif
and it prints HERE2 in the console!
I don't see how this is possible?