SwiftUI Failures in Interfacing with UIKit sample

There are several faliures with completed project https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit

I'm listing them all here since I can't find a way to submit a bug report via Feedback Assisstant.

Tested on beta 1 and beta 2 in simulator and on device.


--- Run the completed project and you get compile error in Home.swift:


Incorrect argument labels in call (have '_:destination:', expected 'destination:label:')


PresentationButton(

Image(systemName: "person.crop.circle")

.imageScale(.large)

.accessibility(label: Text("User Profile"))

.padding(),

destination: ProfileHost()

)


Trying the suggested fix, give another error, for which no fix was suggested:


Extra argument 'labeldestination' in call


I was able to fix by making call like other button:


PresentationButton(destination: ProfileHost()) {

Image(systemName: "person.crop.circle")

.imageScale(.large)

.accessibility(label: Text("User Profile"))

.padding()

}


--- User Profile can only be openned once.

Open the Profile by touching upper right icon, Profile appears. Drag down to get rid of it.

Touching upper right icon no longer presents Profile.


--- In HikeDetail.swift, text buttons at bottom fail to show different graph, instead view is toggled back to invisible.

Added following code in HikeDetail.swift to confirm all three button actions are call on any touch


ForEach(buttons.identified(by: \.0)) { value in

Button(action: {

print("action "+value.0)

self.dataToShow = value.1

}) {


In console:


action Elevation

action Heart Rate

action Pace


--- Attempting to use PageView in Home.swift produces a non-responsive PageView

Modified Home.swift as folllows:


NavigationView {

List {

PageView(features.map { FeatureCard(landmark: $0) })

// FeaturedLandmarks(landmarks: featured)

.scaledToFill()

.frame(height: 200)

.clipped()

.listRowInsets(EdgeInsets())

...


PageView displays but does not respond to touch, only able to test on device.


--- Overall, dissappointed in quality of release. This is more an Alpha release.

Replies

See: https://forums.developer.apple.com/message/366343#366343


In `Home.swift` - change:


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


to:


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