|< How to fix “Cannot convert value of type 'String' to expected argument type 'Binding
||How to fix “Referencing initializer 'init(wrappedValue:)' on 'ObservedObject' requires that ‘SomeType’ conform to 'ObservableObject'" >|
Updated for Xcode 12.0
This is such a common error, and happens because you tried to use a string where SwiftUI expects to have a
Text view. As a simple example, it means creating an alert like this:
There are many places where SwiftUI wants to have a
Text view rather than a plain string, so just wrap your strings in text like this:
SPONSORED Announcing NSSpain 2020: Remote Edition! An online, continuous conference for iOS developers. We’ll start on Thursday and finish on Friday, with talks, activities, and lots of fun for 36 hours, non-stop. Sound good? Join us!
Link copied to your pasteboard.