|
|
|
Hey Now seeks advice for delaying code execution:
This hint might be useful? Wait?! Is it pronouced "Hey Now?" or "Hal No?" |
|
How I would approach:
:) I am sure there is a more sophisticated way, but this what I thought for now.. |
|
|
|
@ioannisfa Not quite figuring it out. Here's my code:
|
|
I like Rooster's delay function. When I did this challenge I used google to get the answer I used.
I don't know if it's the right way or best practice, but it worked for me. |
|
|
|
Late to the show, but I wanted to do the same thing, and I ended up using the following code to make it work. Update
I actually learned this today from the following article: Main Actor Task will allow us to run the code in the background, sleep for x amount of seconds, then MainActor will ensure the next code runs on the UI thread. |
|
@daffyduck Thank you very many of this code snippet. I tried to found this kind of easy solution for delaying Alert. Have to check also that Main Actor infopage. |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
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.