MagnificationGesture or MagnifyGesture

Which ru supposed to use? Magnification Gesture is deprecated and MagnifyGesture is IOs17 only
5 Replies
xPsycHoWasPx
xPsycHoWasPx15mo ago
kinda simple answer ios 16 n down == Magnification ios 17 n up == Magnify
BigWang
BigWangOP15mo ago
Ok
xPsycHoWasPx
xPsycHoWasPx15mo ago
if #available(iOS 17, *) {
print("This code only runs on iOS 17and up")
} else {
print("This code only runs on iOS 16 and lower")
}
if #available(iOS 17, *) {
print("This code only runs on iOS 17and up")
} else {
print("This code only runs on iOS 16 and lower")
}
then u can do both versions you can also mark whole functions like this
swift
@available(iOS 17, *)
func ios17version() {
// ios 17 code
}
swift
@available(iOS 17, *)
func ios17version() {
// ios 17 code
}
xPsycHoWasPx
xPsycHoWasPx15mo ago
Antoine van der Lee
SwiftLee
How to use the #available attribute in Swift
Run code on specific iOS versions, mark methods as deprecated or obsoleted, and rename methods using the available and unavailable attribute.
BigWang
BigWangOP15mo ago
Thanks
Want results from more Discord servers?
Add your server