sindresorhus / Settings

⚙ Add a settings window to your macOS app in minutes
MIT License
1.43k stars 100 forks source link

Support for EnvironmentObject in SwiftUI version #51

Closed fracturedsoftware closed 4 years ago

fracturedsoftware commented 4 years ago

I have been experimenting a bit with the SwiftUI additions to your framework and it would be nice if there was a documented way to attach an EnvironmentObject to a SwiftUI panel

sindresorhus commented 4 years ago

Preferences accepts SwiftUI views, so you can just attach the environment object before passing it in to Preferences.

fracturedsoftware commented 4 years ago

I will try it, thanks!

On 16 May 2020, at 4:09 am, Sindre Sorhus notifications@github.com wrote:

Preferences accepts SwiftUI views, so you can just attach the environment object before passing it in to Preferences.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sindresorhus/Preferences/issues/51#issuecomment-629403729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIM5O6WUUP5SPCUDPUOKGV3RRWANFANCNFSM4M4U6IGQ.

-- Email domain proudly hosted at https://migadu.com

sindresorhus commented 4 years ago

https://github.com/sindresorhus/Preferences#swiftui-support