美文网首页
Lesson10 - PickerView

Lesson10 - PickerView

作者: 茗涙 | 来源:发表于2018-03-24 15:26 被阅读11次

效果图

QQ20180324-152330.gif

项目代码地址

加了一个串行队列来更新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()
        }

相关文章

网友评论

      本文标题:Lesson10 - PickerView

      本文链接:https://www.haomeiwen.com/subject/xxdxcftx.html