New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you use Preferences in a SwiftUI App View? #69
Comments
Why would you use this there? You can just use |
@sindresorhus because SwiftUI doesn't provide a native way to present the Preferences window / add the menu item without doing what @macaaw demonstrates above. The example you provide in your README is out of date and doesn't work out of the box with SwiftUI. |
In swiftui you can use .commands modifier just below Window Group |
How do I use Preferences within SwiftUI app code? The only way I can see is to use Settings with a View.
WindowGroup
{
ContentView()
}
Settings
{
MyCustomSettingsView()
}
The text was updated successfully, but these errors were encountered: