|
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 Optimize your app’s startup time, binary size, and overall performance using Emerge’s advanced app optimization and monitoring tools. Reliably measure app size, speed up your app's startup time with Emerge's Launch Booster, and much more. Emerge is actively used by many of the top mobile development teams in the world.
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.