Skip to content

Removing gesture recognizers is not working in iOS 15 #410

@zoltanbognar

Description

@zoltanbognar

Description

Hello Introspect Team

I'm using your great tool to disable gestures in page TabView
unfortunatly it stop working in ios 15 after switch to new introspect.
in iOS 16 and iOS 17 it is working OK

struct ContentView: View {
    var body: some View {
        TabView {
            Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red)
            Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue)
        }
        .tabViewStyle(.page(indexDisplayMode: .always))
        .introspect(.tabView(style: .page), on: .iOS(.v14, .v15, .v16, .v17)) {
            print(type(of: $0)) // UICollectionView
            $0..gestureRecognizers?.removeAll()
        }
    }
}

note in deprecated style was working:

struct ContentView: View {
    var body: some View {
        TabView {
            Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red)
            Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue)
        }
        .tabViewStyle(.page(indexDisplayMode: .always))
        .introspectPagedTabView { ( _, scrollView) in
                    scrollView.gestureRecognizers?.removeAll()
                }
    }
}

I tried also to introspect the scroll view, but same problem in iOS 15:

struct ContentView: View {
    var body: some View {
        TabView {
            Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red)
            Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue)
        }
        .tabViewStyle(.page(indexDisplayMode: .always))
        .introspect(.scrollView, on: .iOS(.v14, .v15, .v16, .v17)) {
            print(type(of: $0)) // UICollectionView
            $0..gestureRecognizers?.removeAll()
        }
    }
}

Thank You for help
Zoltan

Checklist

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Version information

No response

Destination operating system

No response

Xcode version information

No response

Swift Compiler version information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions