Good day everyone! On Xcode 26 apple make worse Gesture's now! So now my hack doesn't work. But, for iOS 26 I found a new hack, so I updated my prevous solution: public extension View { func resetTappedButtonWhenScrolled() -> some View { modifier(ResetTappedButtonWhenScrolled()) } } private struct ResetTappedButtonWhenScrolled: ViewModifier { @State private var isScrolling = false @ViewBuilder func body(content: Content) -> some View { if #available(iOS 18, *) { content .disabled(isScrolling) .background(ScrollGestureObserver(isScrolling: $isScrolling)) } else { content } } } private struct ScrollGestureObserver: UIViewRepresentable { @Binding var isScrolling: Bool func makeCoordinator() -> Coordinator { Coordinator(isScrolling: $isScrolling) } func makeUIView(context: Context) -> UIView { let view = UIView() DispatchQueue.main.async { if let scrollView = view.enclosingScrollView() { scrollView.panGestureRecognizer.addTarget( context.coordinator, action: #select
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: