xcode - Creating a Neat delay function using NSTimer - Swift -
i trying create simple , neat function uses nstimer add delay ever in brackets. e.g.
func adddelay(delay:double, closure:()->()) { //code in here using nstimer add delay long stated in delay (the number passed in) }
from this, trying aim use going:
delay(1){ //code in here execute after delay of 1 second }
the function needs use nstimer using whole.
any appreciated.
in case, need use extension nstimer. published on gist: https://gist.github.com/dimpiax/e2adc74c25d76d124fc3
update:
published lib: https://github.com/dimpiax/richtimer
Comments
Post a Comment