iOS version

check iOS version

extension Bool {
     /// โญ๏ธ Bool.iOS14
     static var iOS14: Bool {
         guard #available(iOS 14, *) else { return false }
         return true
     }
 }
 
 // use case
 Text("Hello, world!")
    .padding()
    .if(.iOS14) { $0.background(Color.red) }    // โญ๏ธ use case

Last updated