更新时间:2023-02-24 16:10:24
只需将其写在completion handler
中.无需使用dispatch_after
Just write this in completion handler
.No need to use dispatch_after
dispatch_async(dispatch_get_main_queue(), {
let delegateObj = UIApplication.sharedApplication().delegate as YourAppDelegateClass
delegateObj.addUIImage("yourstring")
})
快速3/4:
DispatchQueue.main.async {
let delegateObj = UIApplication.sharedApplication().delegate as YourAppDelegateClass
delegateObj.addUIImage("yourstring")
}
还用于在主队列上发送后
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
// your code here
}
用您的委托类替换YourAppDelegateClass