Git Product home page Git Product logo

Comments (9)

jbromberg avatar jbromberg commented on August 21, 2024 1

@davdroman just opened issue #356. Seems to be the main bug I was encountering.

from swiftui-introspect.

davdroman avatar davdroman commented on August 21, 2024

Please use the new SwiftUIIntrospect module. The old Introspect module is unstable, deprecated, and will be effectively removed this autumn.

https://github.com/siteline/SwiftUI-Introspect#scrollview

from swiftui-introspect.

ralfebert avatar ralfebert commented on August 21, 2024

@davdroman Thanks for your reply; I tried the new module, and introspection started working on iOS 17 again, but then the View that's behind the ScrollView became un-tappable / doesn't react on tap events anymore; so I resorted to the old version because I had fully working solution already for that :) Any hints how I can help to get the tap events issue fixed?

from swiftui-introspect.

davdroman avatar davdroman commented on August 21, 2024

Can you share a small reproducible code sample of the scenario you describe? Thanks in advanced.

from swiftui-introspect.

ralfebert avatar ralfebert commented on August 21, 2024

@davdroman Here you go:

struct ContentView: View {
    @State private var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.5, longitude: -0.1), span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5))
    
    var body: some View {
        ZStack {
            Map(coordinateRegion: $region)
                .ignoresSafeArea()

            self.bottomDrawerScrollView
        }
    }
    
    @ViewBuilder var bottomDrawerScrollView : some View {
        ScrollView([.vertical]) {
            Text("Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum ")
        }
        .offset(x: 0, y: 400)
        .introspect(.scrollView, on: .iOS(.v15, .v16, .v17)) { scrollView in
            scrollView.backgroundColor = .yellow
        }
    }

}

Without the .introspect, you can pan the map, with the .introspect, you can not pan it around anymore.

from swiftui-introspect.

davdroman avatar davdroman commented on August 21, 2024

Thank you! I’ll investigate this later today as I’m currently AFK.

from swiftui-introspect.

davdroman avatar davdroman commented on August 21, 2024

@ralfebert thank you for your patience and for the code sample. I was able to pinpoint the issue and the fix is now available in 0.9.1.

from swiftui-introspect.

jbromberg avatar jbromberg commented on August 21, 2024

I ended up having to revert my apps to use the old version of introspect and the snippet in the first comment due to bugs with the current scrollview implementation.

from swiftui-introspect.

davdroman avatar davdroman commented on August 21, 2024

@jbromberg would you be able to open a new issue explaining what the bugs you've encountered look like? With the upcoming 1.0 release, Introspect will no longer be part of this repo so it's worth fixing any bugs in SwiftUIIntrospect going forward to prevent version lock-in.

from swiftui-introspect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.