Tusker/Packages/ComposeUI/Sources/ComposeUI/View+ForwardsCompat.swift

27 lines
533 B
Swift
Raw Normal View History

//
// View+ForwardsCompat.swift
// ComposeUI
//
// Created by Shadowfacts on 3/25/23.
//
import SwiftUI
extension View {
2023-10-20 02:50:20 +00:00
#if os(visionOS)
func scrollDisabledIfAvailable(_ disabled: Bool) -> some View {
self.scrollDisabled(disabled)
}
#else
@available(iOS, obsoleted: 16.0)
@ViewBuilder
func scrollDisabledIfAvailable(_ disabled: Bool) -> some View {
if #available(iOS 16.0, *) {
self.scrollDisabled(disabled)
} else {
self
}
}
2023-10-20 02:50:20 +00:00
#endif
}