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
386 stars 13 forks source link

Bind presentation to optional #1

Closed otymartin closed 1 year ago

otymartin commented 1 year ago

@nathantannar4

Can we have a PresentationLink triggered by an optional..

Eg: PresentationLink(transition: PresentationLinkTransition, item: Binding<Item?>, destination: () -> View, label: () -> View>)

otymartin commented 1 year ago

Use view modifier...

         }
          .presentation($optionalObject, transition: .sheet(options: .init(detents: [.ideal], prefersGrabberVisible: true, preferredCornerRadius: 16))) { unwrappedObject in
            ContentView(object: unwrappedObject)
        }