效果图
加了一个串行队列来更新pickerview
let serial = DispatchQueue(label: "serialQueue1")
serial.async {
print("A")
self.pickerView.selectRow(Int(arc4random()) % 10, inComponent: 0, animated: true)
}
serial.async {
print("B")
self.pickerView.selectRow(Int(arc4random()) % 10, inComponent: 1, animated: true)
}
serial.async {
print("C")
self.pickerView.selectRow(Int(arc4random()) % 10, inComponent: 2, animated: true)
// ASemaphore.wait()
// BSemaphore.signal()
}