小编kiw*_*iwi的帖子

函数不透明返回类型被推断为...,它根据自身定义了不透明类型

Xcode 给出错误:

函数不透明返回类型被推断为“Button”,它根据自身定义了不透明类型

在下面一行:

@State var showingProfile = false // Could be also Binding or else

var profileButton: some View {
Button(action: { self.showingProfile.toggle() }) { // <- Error on this line
    Image(systemName: "person.crop.circle")
        .imageScale(.large)
        .accessibility(label: Text("User Profile"))
        .navigationBarItems(trailing: self.profileButton)
         .padding() } } }
Run Code Online (Sandbox Code Playgroud)

xcode swift swift4 swiftui

6
推荐指数
1
解决办法
1135
查看次数

标签 统计

swift ×1

swift4 ×1

swiftui ×1

xcode ×1