Post

Replies

Boosts

Views

Activity

Using previewInterfaceOrientation results in runtime crash on iOS 14
Using Xcode 13 beta 2: In my SwiftUI preview code I add previewInterfaceOrientation like so: static var previews: some View { Group { Preview() #if swift(>=5.5) if #available(iOS 15.0, *) { Group { Preview() } .previewInterfaceOrientation(.landscapeRight) } #endif } } With this code and running on an iOS 14 device the app crashes immediately with dyld: Symbol not found: _$s7SwiftUI4ViewPAAE27previewInterfaceOrientationyQrAA0eF0VFQOMQ It would seem I can't use this handy interface orientation option in Previews until the app's minimum target is iOS 15. It seems like a bug in the framework because that symbol should be considered optional as it is surrounded by if #available.
2
0
1.2k
Sep ’21