|
hello i'm very new to programming and i have just start the 100 Days of SwitUI. I really need help because it's been two days since I try to solve the first challenge. I create the buttons in a ForEach and try to access the button selected by the user to check. But the score is very werdly count (i understand that my check function is call several times...) Your help would be very much appreciated. Thank you my code:
|
|
I am a bit busy to debug your code now, but I have written this long time ago, hope it helps. https://github.com/EpiGardenia/100DaysOfSwiftUI/tree/master/Day25_Milestone1 |
|
|
|
i try to improve my code, unfortunately i still have an issue: in the ForEach I get the index of the button to check the answer, but the ForEach repeats 3 times and so the function to check the answer... i don't understand why the function to check repeats 3 times in my code and not in the other solution i could find.
|
|
Your main problem is down to using a Also you do not need the
|
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.
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.