Installation with SwiftUI lifecycle
benjaminleonard opened this issue · comments
Hi there, thanks for the library!
I started reintegrating an app and scene delegate file to my project so that I could install the library before I realised it wasn't necessary. I can create a pull request to add to the documentation for people using the SwiftUI lifecycle if you like? It's super simple but wasn't immediately obvious to me.
In summary:
Add the environment object to the app file:
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(PartialSheetManager())
}
}
Add the Partial View to ContentView as you would already:
struct ContentView: View {
var body: some View {
VStack {
Text("Hello SwiftUI!")
.padding()
}
.addPartialSheet()
}
}
Plus adding import PartialSheet
in the ContentView and App files
Thanks for this! It really helps newbies in SwiftUI like me
Useful comment, thank you!
Check version 3.0 and if you still have the issue, feel free to reopen the issue