Can @MainActor replace DispatchQueue.main?

Hi, guys. The use of @MainActor is confusing? Should I use it only to turn classes into main actors? What if one of my functions access the interface from a closure that could run on a different thread? How do I tell the system to access a label from the main thread? Should I mark the entire view controller class with the @MainActor? Is there anything similar to use with functions or statements or should I still use DispatchQueue.main? Thanks.

Answered by macrojd in 678696022

I got it. It is answered in the Swift Concurrency, Behind the scenes talk.

Thanks

Accepted Answer

I got it. It is answered in the Swift Concurrency, Behind the scenes talk.

Thanks

Can @MainActor replace DispatchQueue.main?
 
 
Q