我有一个ForEach
它需要一个 Binding 并使用 Xcode11 beta5 编译,但使用 beta6 则显示Type of expression is ambiguous without more context
on the Text("...")
在 - 的里面ForEach
我找不到错误。难道我不能再迭代这样的绑定了吗?
struct ForEachItem1: View {
@Binding var items: [String]
var body: some View {
ForEach($items) { item in
Text("Hello world") // Type of expression is ambiguous without more context
}
}
}
struct ForEachItem2: View {
@Binding var items: [String]
var body: some View {
ForEach($items) { (item: Binding<String>) in
Text("Hello world") // Type of expression is ambiguous without more context
}
}
}
的条件符合Binding
to Collection
已删除(有关弃用通知,请参阅 Xcode11 Beta5 发行说明)。在以后的发行说明/版本中找不到它。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)