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
Was this helpful?