Re: [swift-users] Migrating to Swift 3 Dispatch

2016-10-16 Thread Thierry Passeron via swift-users
Thank you all (Ole, Rien, Adrian)! It’s alive! You are right it’s a shame how poorly it is documented at the moment. There are many overloads of « scheduleRepeating() » with different parameters and the headers are not that helpful… Thanks again. > Le 17 oct. 2016 à 00:32, Hooman Mehr a écrit

Re: [swift-users] Migrating to Swift 3 Dispatch

2016-10-16 Thread Hooman Mehr via swift-users
> On Oct 16, 2016, at 11:25 AM, Thierry Passeron via swift-users > wrote: > > Hello All, > > I’m in the process of migrating older code to Swift 3 and I’m stuck on this > one. > How do you create a timer dispatch source? > > Old code: > > let source = dispatch_source_create(DISPATCH_SOURCE_

Re: [swift-users] Migrating to Swift 3 Dispatch

2016-10-16 Thread Ole Begemann via swift-users
I’m in the process of migrating older code to Swift 3 and I’m stuck on this one. How do you create a timer dispatch source? Old code: let source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue) dispatch_source_set_timer(source, dispatch_time(DISPATCH_TIME_NOW, 0), UInt64(inter

Re: [swift-users] Migrating to Swift 3 Dispatch

2016-10-16 Thread Rien via swift-users
I’am not familiar with “timer dispatch source”. Do you want to run some closure at time X? Does this help? let dpt = DispatchTime.now() + delta * Double(NSEC_PER_SEC) queue.asyncAfter(deadline: dpt) { … } Regards, Rien. > On 16 Oct 2016, at 20:25, Thierry Passeron via s

[swift-users] Migrating to Swift 3 Dispatch

2016-10-16 Thread Thierry Passeron via swift-users
Hello All, I’m in the process of migrating older code to Swift 3 and I’m stuck on this one. How do you create a timer dispatch source? Old code: let source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue) dispatch_source_set_timer(source, dispatch_time(DISPATCH_TIME_NOW, 0), U