Debugging SwiftUI’s Entry Macro
Michael Long ∙ 5 min read![]() ∙ View on MediumDebugging SwiftUI's Entry MacroThe new way isn't quite like the old way. And that was a problem.![]() If you've ever created your own Environment variables in SwiftUI you know that you have to generate a bit of boilerplate code to do so. We need to define an Here's some code that defines a new Navigator environment variable for my new SwiftUI open source library, Navigator. // key with default value private struct NavigatorKey: EnvironmentKey { static let defaultValue: Navigator = Navigator(owner: .default) } // getter/setter pair extension EnvironmentValues { public var navigator: Navigator {… Continue reading This is a member-only story and can only be read on Medium. Sent to sikubaycom.s3cr3tz@blogger.com by Michael Long on Medium Unsubscribe from this newsletter or unsubscribe from all newsletters from Medium Manage your email settings Medium, 548 Market St, PMB 42061, San Francisco, CA 94104 Careers·Help Center·Privacy Policy·Terms of service |