SwiftUI Tutorial PresentationButton Bug

前端 未结 4 1341
生来不讨喜
生来不讨喜 2020-12-06 03:22

I started to experiment with the new SwiftUI framework, announced on the WWDC 2019 and started the tutorial on https://developer.apple.com/tutorials/swiftui.

Now I c

4条回答
  •  生来不讨喜
    2020-12-06 04:01

    The most simple way to solve this issue is by leaving the destination: parameter on its own and have the Image object in the curly braces:

    PresentationButton(destination: ProfileHost()) {
        Image(systemName: "person.crop.circle")
            .imageScale(.large)
            .accessibility(label: Text("User Profile"))
            .padding()
    }
    

提交回复
热议问题