Trying to call dispatch_time in Swift makes my head, here's why:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), { doSomething() })
Error result: "Could not find an overload for" * "that takes the provided arguments."
NSEC_PER_SEC is UInt64, so the time for some experiments is:
let x:UInt64 = 1000 let m:Int64 = 10 * x
Results with the same error as above
let x:UInt64 = 1000 let m:Int64 = 10 * (Int64) x
Results in "Consecutive statements on a line must be separated by a character"; "
let x:UInt64 = 1000 let m:Int64 = 10 * ((Int64) x)
Results in Expected, Separator
let x:UInt64 = 1000 let m:Int64 = (Int64)10 * (Int64) x
Results in "Consecutive statements on a line must be separated by a character"; "
Etc. etc.
Damn you, Swift compiler, I give up. How do I enable UInt64 in Int64 and / or how do you use dispatch_time in swift?
source share