Skip to content

Commit

Permalink
Don't hijack touches for iOS 15
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 committed Aug 6, 2024
1 parent 66c5888 commit 53dc255
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions DuckDuckGo/ViewExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ extension View {
}

extension View {
/// Disables scroll in a backwards-compatible way.
///
/// Keep in mind fallback version may have unforeseen consequences.
/// Verify if it does not break anything else for you.
/// Disables scroll if allowed by system version
@ViewBuilder
func withoutScroll() -> some View {
func withoutScroll(_ isScrollDisabled: Bool = true) -> some View {
if #available(iOS 16, *) {
scrollDisabled(true)
scrollDisabled(isScrollDisabled)
} else {
gesture(DragGesture(minimumDistance: 0, coordinateSpace: .local), including: .gesture)
self
}
}
}
Expand Down

0 comments on commit 53dc255

Please sign in to comment.