|
Feeling depressed and frustrated if I am being honest. I understood every single concept along the way and practiced along in playground but on the second project, I don't know where to start with challenge questions. Do I need to revisit the material from the begining? I even redid project 2 like 5 times to understand and I understand what's being done but when I try to do the challenge questions, it's like I don't know where to start. It's been 5 days now and I vowed not to look at any solutions until I figure it out myself but I'd like to hear some insights. |
|
Its called "Coder's Black Hole", no need to feel defeated, just move on, we all go through it .. |
|
I know if I move on, I am going to find myself doing the same exact thing on the next project. Any other takers? |
|
@Geel is frustrated:
I didn't follow the UIKit path. I had tried UI Kit via other tutorials (CS193p, and Angela Yu's courses). I found them frustrating too. You don't say which challenge question you're struggling with, there are three. Break your big problem into several smaller, solvable problems.But perhaps you can step away from the code for a bit, and first solve this on paper.
Solve this on paper before trying to code this.
You can't have 1.45 questions, or "grok" questions. So you know you'll be keeping track of questions via an integer. What's a good name for an integer to track number of questions asked? Do you have a function in your program that generates a question? Do you have a function that runs when a player makes a selection?
If the |
|
This one is pretty simple. There is currently a line of code in your project that you used to set the title of the navigation bar to show the name of a country...
Can you modify that line of code to show the score as well?
This one is a little more complicated. But, you have been shown some examples of how these things can be done. First you just have to create a variable to hold an integer value for the Then you have to make sure that But now, we only want Otherwise ( You have seen how to create and show an alert controller already...
Now you just have to make your own. The first line in this example creates an alert controller with the title and message that we want it to show. The second line adds a button to the alert controller. The third line makes the alert controller show on the screen.
After you have completed the first two challenges, this one should be a little bit easier to figure out. It's kind of a combination of the concepts we used in the first two challenges in a way. We just need to find the code for the alert controller that currently shows when the user taps one of the flag buttons, and change the message string to include a variable in it like we did in challenge one. But, we want to show one message when the answer is wrong, and another when the answer is correct, so, we will probably need to use The tricky part is figuring out where to put the
Notice how we are using a variable for the title here, but typing a |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.