I have an old iOS application developed with Swift 1.2. In that used dispatch queues for speed up runtime.
dispatch_async(dispatch_get_main_queue()) {
}
In Swift 4 I have tried by changing like below
DispatchQueue.main.async { [weak self] in
if let strongSelf = self {
strongSelf.imapFetchFoldersOp?.start({ (error, folders) -> Void in
if let error = error {
#if DEBUG
print("\(String(describing: error._userInfo))")
#endif
} else {
strongSelf.folders = folders! as NSArray
strongSelf.fetchInfoForBoxes()
print("Floders :\(folders!)")
}
})
}
}
Did I do it correctly or do I need to modify?