Post

Replies

Boosts

Views

Activity

Reply to Check if iOS 14 is available in SwiftUI body
Following from @macasasa's answer, using a @ViewBuilder and wrapping only the iOS 14 code in AnyView works for me. E.g. @ViewBuilder     private var textImageView: some View {         if #available(iOS 14.0, *) {             AnyView(Label {                 text             } icon: {                 image             })         } else {             HStack {                 image                 text             }         }     }
Aug ’20