|
Good day all! I have some questions about the 21st day Here is my code:
|
|
Maybe this will help As for the
works because the |
|
One more question :)
The rest of the code:
Because I still don't get it |
|
The In flagTapped
is the check for the good answer.
The |
|
I like to think of So look at this code as the instructions to a factory. And ask yourself, What kind of views is this factory going to make?
Next question to ask yourself.... How many buttons is this factory going to make?
This In iOS applications, buttons usually have a label and will perform some action when tapped by your user! So ask yourself these final two questions:
You can see from the code that the So as the When the player presses a flag button, it executes the |
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
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.