|< 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.5
This is a really 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 ViRE offers discoverable way of working with regex. It provides really readable regex experience, code complete & cheat sheet, unit tests, powerful replace system, step-by-step search & replace, regex visual scheme, regex history & playground. ViRE is available on Mac & iPad.
Link copied to your pasteboard.