Updated for Xcode 14.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:
Alert(title: "Meh")
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:
Alert(title: Text("Meh"))
SPONSORED Build a functional Twitter clone using APIs and SwiftUI with Stream's 7-part tutorial series. In just four days, learn how to create your own Twitter using Stream Chat, Algolia, 100ms, Mux, and RevenueCat.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.