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」錯誤。這將是一個很好的解決辦法?