I am trying to implement Toggle Switch as you see in the picture below, but I obtain the following error (the part on light red in the picture) using Xcode 14 and macOS 12.6.3:
I am refering also to the apple documentation https://developer.apple.com/documentation/swiftui/toggle/init(_:sources:ison:)-39rkx
But it gives the same code. I would appreciate an idea on how to fix it. Thank you!