I have small restaurans data in content view, but I want to use this data shortly inside of the homeview,
I am typing to use
@State var restaurants: [ Restaurant]
but in other view I have HomeView, it is throw an error like Cannot convert value of type '[Restaurant].Type' to expected argument type '[Restaurant]'
for
HomeView( restaurants: [Restaurant])
line of code, I do not know what I missed? Any idea?
struct HomeView: View {
@State var restaurants = [ Restaurant(name: "Cafe Deadend", image: "cafedeadend"),
Restaurant(name: "Homei", image: "homei"),
Restaurant(name: "Teakha", image: "teakha"),
Restaurant(name: "Cafe Loisl", image: "cafeloisl"), ]
}