Home > Back-end >  Do we need to perform the alpha change operation inside Main Queue in Swift?
Do we need to perform the alpha change operation inside Main Queue in Swift?

Time:12-31

The saying "All the UI operations should be performed inside the main queue" becomes a little confusing when it comes to alpha. I have doubt do we really need to perform a simple alpha change operation inside the main Queue?

self.presentingViewController?.view.alpha = 0.6 // such operations 

CodePudding user response:

do we really need to perform a simple alpha change operation inside the main Queue?

Yes we do. Basically you don't want to do anything to a view off the main thread. And do not try to cheat by shifting the burden to the view's layer.

  • Related