Spot on!
Makes it a lot easier to keep playing
Spot on!
Makes it a lot easier to keep playing
Hi @audrey, Iâve noticed that in your example the main VStack appears to be stretched to a full height.
But when Iâve run my own code or tried to run the finished example the VStack takes a portion of the screenâs height.
I havenât found any solution online unfortunately, do you have any idea?
Xcode Version 11.0 (11A419c)
hi Oron! try adding Spacer()
:
var body: some View {
VStack {
Text("Hello World")
Spacer()
Text("Hello World")
Spacer()
Text("Hello World")
}
}
Or, do you mean that my RGBullsEye code doesnât cover the screen?
Hi, thanks for your response Audrey,
I was talking about RGBullsEye, and I well know the Spacer
but I donât think itâs the solution here.
Since in your example it seems that the Rectangle
takes over the entire remaining height of the screen but it just donât happen, not in the finished example and not when I try to code it myself.
Iâve just downloaded the project from the tutorial page and opened it in Xcode 11.1 on Catalina:
The problem might be with your installation of Xcode? Try restarting Xcode or Mac, or reinstall Xcode. Delete any earlier versions of Xcode, too.
Updating Xcode did resolve the issue, thanks!
hello @audrey! Thank you so much for the tutorial
Maybe you can help me solving my SwiftUI problem, canât find the answer: when Iâm starting preview, for some reason I canât change anything, I can only select the window, but canât work with the instructor (so that I can make changes only using code). What can be the problem?
Thank you in advance!
hi Julia! I think your auto-correct did something, and the word turned into âinstructorâ
do you mean you want to do something like this?
I only recently realised that Command-click doesnât work for everyone. Some people have that shortcut set to âJump to definitionâ. If thatâs happening to you, then use Control-Command-click instead.
I agree with anmâ8tr that the tutorial becomes confusing here. Up to " The new VStack
will contain three sliders, and there will be a button between the color blocks and the sliders." it is clear. After that, âNow, practice your new SwiftUI-fu skills to start filling in the color blocksâ. What color blocks? There is no context given around the code. What is the screen supposed to look like when finished this step?
hi Victor! Iâve added a screenshot of the finished UI, just before you start outlining the view. Hope this helps!
Itâs clear with the downloaded resources, but it could be more clear if you included context. To illustrate what I mean take a look at the part of the tutorial where you said, âName the ExtractedView
ColorSlider , then add these lines at the top, before the body
closure:â. The previous time the body closure was mentioned, it referred to the closer in a different class. A newb might think you meant that same place, which, of course, doesnât work. If your sample code included context, and by that, I mean some lines surrounding what is being added, that would serve to clarify which body you were referring to. Experienced developers would have no issue with this, but newbs, who are probably the main target of these tutorials, would really benefit from the context, in my opinion.
thanks Victor! I wrote this article during WWDC, so the expected audience was early-adopters who were willing to grapple with Xcode and macOS betas. Iâve updated it now to be more newbie-friendly.
This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!