1
此代码必须被转换为斯威夫特3.Xcode的斯威夫特3计时器错误
func checkIfCorrect (_ buttonPressed:Int) {
if buttonPressed == playlist[numberOfTaps] {
if numberOfTaps == playlist.count - 1 { // we have arrived at the last item of the playlist
let time = DispatchTime(uptimeNanoseconds: DispatchTime.now()) + Double(Int64(NSEC_PER_SEC))/Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(deadline: time, execute: {
self.nextRound()
})
return
}
代码返回,说:“无法将类型的价值‘DispatchTime’预期参数类型UINT64”错误。这将是一个很好的解决办法?