|< 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 13.0 beta 2
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 From August 2nd to 8th you can join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!
Link copied to your pasteboard.