SwiftUI @Entry isn't working

I am trying to use the new @Entry macro to add new EnvironmentValues as the documentation: https://developer.apple.com/documentation/swiftui/entry() say but I keep getting errors.

I am using iOS 17.4, Xcode 15.3.

Answered by SpaceMan in 797480022

This works in Xcode Version 16.0 beta 4 (16A5211f)

Accepted Answer

This works in Xcode Version 16.0 beta 4 (16A5211f)

@SpaceMan why the documentation says it’s available from iOS 13 then ? If it’s only available in Xcode 16

@EngOmarElsayed The issue seems to be resolved in newer Xcode version as @SpaceMan mentioned, however please see Bug Reporting: How and Why? and file a bug report.

SwiftUI @Entry isn't working
 
 
Q