Xcode 12中的SwiftUI @ViewBuilder问题无法在View扩展中编译项目

问题描述

嗨,我在Xcode 12 Beta 1-6(SwiftUI 2.0)中的项目/构建编译中遇到问题,在这种情况下,扩展名为modifier自定义View

extension View {
    public func alert(isPresented: Binding<Bool>,@viewbuilder _ alert: () -> TextFielDalert) -> some View {
        self.modifier(TextFielDalertModifier(isPresented: isPresented,alert: alert()))
    }
}

您可以在代码段中看到,一旦我从参数列表中删除@viewbuilder,就可以编译并运行build。 如果此属性存在于参数中,那么我将面临以下编译错误(Type of expression is ambiguous without more context)

enter image description here

我看不到SwiftUI 1.0(Xcode 11)有任何问题,你们当中有人看到此问题吗? &可能是什么原因。任何提示将不胜感激。

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)