In Swift how to call method with parameters on GCD main thread? -
In my app I have a function that creates an NSRURL session and uses
Sesh.dataTaskWithRequest (req, completionHandler: {(Data, Feedback, Error)
In this whole block of work, I need to make some calculations which call Adds a UIImage to the View Controller if I calculate the UIMAJ-add, so if I try to run it then the integer To see the code inside the block, Xcode says an error that I can not use the layout engine in the background process, so I found some code on SO, which tries to line a method on the main thread:
Just type it in the Swift 3: .main.asyncAfter (deadline: .now () + 0.1) {// your code here} change completion handler
. There is no need to use dispatch_start_start
dispatch_async (dispatch_get_main_queue ()), {Representative Representative OBZ = UIApplication Edit Your Ad Representative as the representative of the Cloud. Oz UDIJ ("your strings")}
Dispatch Queue .main.async {delegateObj = UIApplication SharedApplication () Representative to for remittance to the main line
Dispatches Queue as YourAppDelegateClass delegateObj.addUIIage ("yourstring")}
YourAppDelegateClass
representative class with you
Comments
Post a Comment