Strange behavior within NavigationViews
First off, I really like this package. Unfortunately, it behaves strangely with NavigationViews: content appears to "fly in" from off the screen. Demo code:
import SwiftUI
import CustomModalView
struct Tester: View {
@State private var customModal = false
var body: some View {
NavigationView {
List {
Button("Click me") {
customModal.toggle()
}
}
.listStyle(InsetGroupedListStyle())
.navigationTitle("Hi")
}
.modal(isPresented: $customModal) {
Text("Hi")
.padding()
}
}
}
Moving the view modifier somewhere else—such as attaching it to the Button fixes the "fly in" issue, but then the modal only displays over the button, not the full screen.
Tested on Xcode 12.5 and iOS 14.6.
I'm getting several [LayoutConstraints] Unable to simultaneously satisfy constraints. warnings when a modal displays a VStack > NavigationView > Form
Setting the NavigationView .navigationViewStyle(.stack) property got rid of the layout warnings I mentioned - perhaps this will work with your problem
https://developer.apple.com/forums/thread/673113