Synchronizing issue with delays in loops
问题 I'm trying to delay specific threads inside a loop and I am not getting the behavior I want. I would like 1B to run only once 1A has been completed, while 2A runs in parallel on a separate thread. My implementation runs 1A then 1B then 2A instead. Any idea how I can fix this? Implementation override func viewDidLoad() { super.viewDidLoad() // 1 DispatchQueue.main.async { self.loopManager(printable: "1A") // 1A self.loopManager(printable: "1B") // 1B } // 2 DispatchQueue.main.async { self