< How to fix “Cannot convert value of type '() -> ()' to expected argument type '() -> _’” | How to fix images not resizing > |
Updated for Xcode 14.2
This error usually comes up because you created the wrong kind of view by accident, and rather than using a simple view instead created a container that expected some content inside it.
Try looking for code like this:
VStack()
VStack
expects to have something inside it, so at the very least that ought to read as follows:
VStack {
EmptyView()
}
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.