Suchergebnisse für Anfrage "dispatch-async"

12 die antwort

Wie kann ich "dispatch_sync", "dispatch_async", "dispatch_after" usw. in Swift 3, Swift 4 und darüber hinaus ausführen?

Ich habe viel Code in Swift 2.x- (oder sogar 1.x-) Projekten, der so aussieht: // Move to a background thread to do some long running work dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { let image = ...

2 die antwort

Anwendung für lange Zyklusblöcke

Ich habe folgenden Zyklus in meiner App var maxIterations: Int = 0 func calculatePoint(cn: Complex) -> Int { let threshold: Double = 2 var z: Complex = .init(re: 0, im: 0) var z2: Complex = .init(re: 0, im: 0) var iteration: Int = 0 repeat { z2 ...

8 die antwort

Swift 3 Warnung für Versand async

Ich habe diesen Code: DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async { let url = URL(string: itemImageURL ) let data = try? Data(contentsOf: url!) if data != nil { DispatchQueue.main.async{ cell.advImage!.image = ...

TOP-Veröffentlichungen