You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Xcode SwiftUI iOS app, paste this into the ContentView.swift file:
importSwiftUIstructUser: Identifiable {
letid = UUID()
varname: StringvarisContacted = false
}
finalclassModel: ObservableObject {
@Publishedvarusers: [User]
init(_users: [User]) {
self.users = users
}
}
structContentView: View {
@EnvironmentObjectprivatevarmodel: Modelvarbody: someView {
List($model.users) { $userinitemView(user: $user) // <=== !!! very odd, no compile error here, but error over at the func definition!itemView($user: $user) // change the previous line to this the error below goes away
}
}
// there is nothing wrong with this, but if the call site is wrong, compiler error here// this erroneous error message makes to look like the func definition here is wrong, but it's fine funcitemView(@Bindinguser: User) -> someView { // <=== !!! why compile error here? => Property type 'Binding<User>' does not match 'wrappedValue' type 'User'// fix the call site, this error goes awayEmptyView()
}
}
Environment
Xcode Version 13.0 beta 4 (13A5201i)
Additional Detail from JIRA
md5: 4e028df6a9b1906d7436b447fa621fed
Issue Description:
Create a Xcode SwiftUI iOS app, paste this into the ContentView.swift file:
See: https://forums.swift.org/t/for-swiftui-list-rowcontent-how-to-define-a-func-with-a-binding-property-wrapper-as-parameter/50782/9
The text was updated successfully, but these errors were encountered: