I have a Button that shows a View using the sheet modifier. The view comes from below. I would like to change the transition, and drop the view from above.
I tried to use
.rotationEffect(Angle(degrees: 180))
but only the View inside the SheetHostingController is rotated.
This is my code
Button(action: { self.showingModal.toggle() }) {
Text("Modal")
}.sheet(isPresented: $showingModal) {
ContentView(showingHome: self.$showingModal)
}
}
The method to make a view transition from top is
.transition(.move(edge: .top))
You must add an animation modifier to control this transition
You can combine this transition with other transitions using
.combined(with:)
While using modals, I don't think you can add transitions to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With