Dieser Code werden musste, um Swift 3.Xcode Swift 3 Timer Fehler
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
}
umgewandelt
Der Code gibt einen Fehler, der sagt „Kann‚DispatchTime‘zu erwarten Argument Typ UInt64 nicht Wert vom Typ umwandeln“. Was wäre eine gute Lösung dafür?