-4

I'm following a tutorial on the internet for creating an app, but it's a bit old. During the tutorial, he uses this code:

dispatch_async(dispatch_get_main_queue(), { () -> Void in // Action }) 

The problem is that - I think - this type of code was deprecated with Swift 4: what do I have to do to "translate" it and use it in my app?

0

1 Answer 1

1

swift 4.2 / Xcode 10.1

if you need to run your code block in the main thread:

DispatchQueue.main.async { //your code block } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.