iOS 16.4 added features that allow us to specify presentation detents. For example:
@State var isSheetPresented: Bool = false
@State var detent: PresentationDetent = .height(200)
MyView()
.sheet(isPresented: $isSheetPresented) {
MySecondView()
}
.presentationDetents([.height(200), .height(500)], selection: $detent)
Now detent
has two settings, 200 and 500, and it switches when the user swipes up or down on the sheet. Is it possible in iOS 16.4 to determine the height of the sheet during this swiping process? During the swipe, the height goes from 200 to 500, and if I wanted to base some animations of this value, could I do that?