|
On day 21, as a wrap up we are asked to try and show our score as well as the name of the country in the navigation bar. I have tried various methods but I havent found out how to do it, and I am also struggling with the second challenge, to track the questions that have been asked, I'm thinking maybe tracking how many times the askQuestion function has been called? I do not know how to do that. |
|
For the first one, just set the As for the second one, you're right. You need to create a counter and increment it in the |
|
Yes, I know how to make the title show, like the name of the country but we are also meant to make our score show, meaning it'll be two titles, this is where I am confused. Thank you |
|
No. It's a single title. You just put the country name and the score in a string and set it as the title. That's all.
|
|
|
|
|
|
|
|
|
|
|
|
My pleasure, so what have you tried as a way to note the amount of times the question function has been called? I'll give you a clue, create a variable first and set it to zero, and you would like to put this variable into a certain function, and increment this variable in this function. Can you guess the function? As for the third one, you should be working with the else, in your buttonTapped function. When the score is wrong, and put what is asked. |
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
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.