|
|
|
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. |
GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
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.