UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Using Presentation Detents Elsewhere

Forums > SwiftUI

Does anyone know if it's possible to use PresentationDetent in other applications? I've managed to pass a PresentationDetent to whatever function/class/struct I like, but I can't figure out how to determine what kind of detent it is (.large, .medium, .fraction, or .height). All I get for auto-complete when I store one in a variable is hashValue, self, and hash(into:).

1      

If you look at Apple Document presentationDetents(_:)

You will see

Sets the available detents for the enclosing sheet.

But you can make custom height and one the sheet only pop up to the content height

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.