Post

Replies

Boosts

Views

Activity

Reply to @Environment example out of Apple's own SwiftUI comments fails to compile
The reason that you need to used the fully qualified namespace ie add @SwiftUI.Environment is that there is another object defined with that name. If you click 'Jump to Defintion' in Xcode it will not work, but if you search your project for 'Environment' you will see where else it is defined. You can rename that version to avoid having to prefix all your @Environment calls with SwiftUI
Aug ’24