Disable beta API reference
This commit is contained in:
@@ -2,22 +2,22 @@ import SwiftUI
|
|||||||
|
|
||||||
public extension View {
|
public extension View {
|
||||||
func onChangeCompat(of value: some Equatable, _ action: @escaping () -> Void) -> some View {
|
func onChangeCompat(of value: some Equatable, _ action: @escaping () -> Void) -> some View {
|
||||||
if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) {
|
// if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) {
|
||||||
return onChange(of: value, action)
|
// return onChange(of: value, action)
|
||||||
} else {
|
// } else {
|
||||||
return onChange(of: value) { _ in
|
onChange(of: value) { _ in
|
||||||
action()
|
action()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
func onChangeCompat<V>(of value: V, _ action: @escaping (_ newValue: V) -> Void) -> some View where V: Equatable {
|
func onChangeCompat<V>(of value: V, _ action: @escaping (_ newValue: V) -> Void) -> some View where V: Equatable {
|
||||||
if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) {
|
// if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) {
|
||||||
return onChange(of: value) { _, newValue in
|
// return onChange(of: value) { _, newValue in
|
||||||
action(newValue)
|
// action(newValue)
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
return onChange(of: value, perform: action)
|
onChange(of: value, perform: action)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user