Xcode 11 Beta 5 Building Lists and Navigation

In the "Building Lists and Navigation" tutorial, Section 2, we are supposed to add the line

landmark.image(forSize: 50)

to the body of LandmarkRow. Unfortunately, this method is not defined in the Landmark structure of the file to be downloaded. It is defined in the Landmark.swift file in the documentation, but when I tried to include that definition in the downloaded file, I was told that the "size" parameter is extra in the call:

ImageStore.shared.image(name: imageName, size: size)


Looking at the ImageStore class, it seems that the image method is indeed defined to take a single parameter: the name.


I know this is more in the line of reporting something rather than asking a question, but it would seem that removing the tutorial altogether would be preferable to removing a function from a structure definition and leaving the learner wanting.


So, to the point... is there a way to scale this image? What is the preferred way to "constrain" an image to a particular point size in SwiftUI?


Thanks in advance for any help,


Rick Campbell

Accepted Reply

Seeing the many posts on this landmark tutorial, seing the bug reports in Release notes of XCode 11 beta5, seing how the rules change at each beta, Ii would consider safer to skip this speciic tutorial for the timpe being… until it is a bit stabilized.

Replies

Seeing the many posts on this landmark tutorial, seing the bug reports in Release notes of XCode 11 beta5, seing how the rules change at each beta, Ii would consider safer to skip this speciic tutorial for the timpe being… until it is a bit stabilized.

Fair enough, and I was on the point of abandoning the tutorial and just reading the docs. Thanks for your quick reply.


(edit) I did get an answer to the question of resizing by "jumping ahead." In the "Handling User Input" tutorial, the code for the image in the Landmark Row has been updated:


landmark.image
                .resizable()
                .frame(width: 50, height: 50)

So, for anyone else looking at this particular issue, there you go.


Thanks again