|
Dear Team, I am unable to complete the last (third) challenge here. My primary confusion is: How do I trigger a function without a button? I tried to create a static computed property to have it triggered by @State, but a computed property requires a type annotation — which confuses me because the function doesnt return anything... What do I do? I'm considering rewatching everything from before Day 15... but I don't know if there is something obvious I am missing. Please help me if you can. Best, Ara.
|
|
It seems that you have identified the only thing that is stopping you. Now, how can you fix that? |
|
Computed property is the right choice, but no need to make it static.
and in your section you can simply adjust as follows:
|
|
Triggering a function without a button can be a real game-changer, much like finding the perfect pickleball paddle. In the world of programming, there are various methods like using event listeners, timers, or even user interactions to execute functions without a direct button click. It's all about finding the right technique that suits your specific needs. Just like choosing the ideal pickleball paddle enhances your game, mastering these programming tricks elevates your coding skills. Happy coding, and here's to both seamless functions and winning shots on the pickleball court. |
|
Thank you all for your help. Here's the finished code — it works! But, does anyone have any pointers for improvement? Anything I can add or remove to it more efficient, maybe?
Best, Ara. |
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!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.