Swift: Simple DispatchQueue does not run & notify correctly
问题 What i am doing wrong? At playground it runs as it should. But as soon as i deploy it on iOS simulator it returns the wrong sequence. @objc func buttonTapped(){ let group = DispatchGroup() let dispatchQueue = DispatchQueue.global(qos: .default) for i in 1...4 { group.enter() dispatchQueue.async { print("🔹 \(i)") } group.leave() } for i in 1...4 { group.enter() dispatchQueue.async { print("❌ \(i)") } group.leave() } group.notify(queue: DispatchQueue.main) { print("jobs done by group") } }