SwiftUI: after update to beta 7: using presentationMode raises error: dyld: lazy symbol binding failed
SwiftUI: after update to beta 7: using presentationMode raises error: dyld: lazy symbol binding failed
我正在开发 Mac 应用程序并使用这样的代码关闭视图:
struct SwiftUIView: View {
@Environment(\.presentationMode) var presentationMode : Binding<PresentationMode>
var body: some View {
HStack {
Text("Hello World!")
Button(action: {
self.presentationMode.value.dismiss()
}) {
Text("Button")
}
}
}
}
它在 beta 6 中运行良好,但在 beta 7 之后,审查不起作用,我在运行时遇到了这个错误:
dyld:惰性符号绑定失败:未找到符号:_$s7SwiftUI7BindingV5valuexvg 当我删除此行时 "self.presentationMode.value.dismiss()" 它工作正常
PresentationMode 不再有值,现在是 wrappedValue。您缺少的符号是 SwiftUI.Binding.value.
我正在开发 Mac 应用程序并使用这样的代码关闭视图:
struct SwiftUIView: View {
@Environment(\.presentationMode) var presentationMode : Binding<PresentationMode>
var body: some View {
HStack {
Text("Hello World!")
Button(action: {
self.presentationMode.value.dismiss()
}) {
Text("Button")
}
}
}
}
它在 beta 6 中运行良好,但在 beta 7 之后,审查不起作用,我在运行时遇到了这个错误: dyld:惰性符号绑定失败:未找到符号:_$s7SwiftUI7BindingV5valuexvg 当我删除此行时 "self.presentationMode.value.dismiss()" 它工作正常
PresentationMode 不再有值,现在是 wrappedValue。您缺少的符号是 SwiftUI.Binding.value.