I decided to implement a few views using SwiftUI in my app. The app is backward compatible with iOS 12.
Everything works perfectly until I run it on an iOS 12 device. The app crashes immediately and the warning I get says SwiftUI cannot be loaded.
dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
Referenced from: /var/containers/Bundle/Application/MyApp.app/MyApp
Reason: image not found
I'm using @available(iOS 13.0, *) in all the correct places and there are no compiler warnings and the app runs perfectly on iOS 13
How can I get this to work for iOS 12?