Skip to content

Instantly share code, notes, and snippets.

@burnsra
Last active March 31, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burnsra/7f5d03889aa0896bb1162e8b8d5c989a to your computer and use it in GitHub Desktop.
Save burnsra/7f5d03889aa0896bb1162e8b8d5c989a to your computer and use it in GitHub Desktop.
Non-blocking NSTimer
var timer: NSTimer?
timer = NSTimer.scheduledTimerWithTimeInterval(5.0, target: self, selector: #selector(self.test(_:)), userInfo: nil, repeats: true)
NSRunLoop.mainRunLoop().addTimer(timer!, forMode: NSRunLoopCommonModes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment