@MainActor
All user interface changes are updated in the main queue, and some async processes such as async image fetching/loading, update network response to list or grid.
What is a MainActor?
@MainActor is a globally unique actor providing an executor which performs its tasks on the main thread.
It is an example of a GlobalActor
How to use MainActor?
When you put @MainActor on one of them, we can make them perform their tasks on the main thread.
Adding @MainActor
on a class
on a property
on a function
on a closure
Direct Call
It comes with an extension that you can call directly