nathantannar4 / Transmission

Bridges UIKit presentation APIs to a SwiftUI API so you can use presentation controllers, interactive transitions and more.
BSD 2-Clause "Simplified" License
378 stars 13 forks source link

DismissPresentationLink stopped working #44

Closed PhilipDukhov closed 3 months ago

PhilipDukhov commented 3 months ago

The DismissPresentationLink in the code below works fine in 1.2.0 and doesn't work in 1.2.1.

struct Issue44: View {
    var body: some View {
        ZStack {

        }
        .presentation(
            transition: .slide,
            isPresented: .constant(true)
        ) {
            DismissPresentationLink {
                Text("Close")
            }
        }
    }
}
nathantannar4 commented 3 months ago

hmm not able to reproduce.

struct Issue44: View {
    @State var isPresented = true
    var body: some View {
        ZStack {
        }
        .presentation(isPresented: $isPresented) {
            DismissPresentationLink {
                Text("Close")
            }
        }
    }
}
PhilipDukhov commented 3 months ago

hmm not able to reproduce.

My bad, forget to define lumaFullScreenSheet. Updated my minimal reproducible example - it happens with .slide transition

jacksonh commented 3 months ago

Seeing the same with slide transitions. Here is a modified content view from the example app:

struct ContentView: View {

    @State var isStatusBarHidden: Bool = false
    @State var statusBarStyle: StatusBarStyle = .default
    @State var isHeroPresented: Bool = false
    @State var progress: CGFloat = 0

  @Environment(\.presentationCoordinator) var presentationCoordinator

    var body: some View {
        NavigationView {
            List {
              PresentationLink(transition: .slide(edge: .trailing)) {
                VStack {
                    Text("Hello, World 1.")

                    DismissPresentationLink {
                        Text("DismissPresentationLink")
                    }

                  Button(action: {
                    presentationCoordinator.dismiss()
                  }) {
                    Text("Call .dismiss")
                  }
                }
              } label: {
                  Text("Fullscreen")
              }
            }
            .navigationBarTitleDisplayMode(.inline)
            .navigationTitle("Transmission")
            .prefersStatusBarHidden(isStatusBarHidden)
            .preferredStatusBarStyle(statusBarStyle.toUIKit())
        }
        .navigationViewStyle(.stack)
    }
}

with this version, both dismiss buttons don't work, but I can use the slide gesture to dismiss the fullscreen view.

nathantannar4 commented 3 months ago

Ak than you. Patched in 1.3.0 sorry!