Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var timer : NSTimer?
  2.  
  3. func startTimer()
  4. {
  5. if timer == nil {
  6. timer = NSTimer.scheduledTimerWithTimeInterval(timeInterval, target: self, selector: "timerFired", userInfo: nil, repeats: true)
  7. }
  8. }
  9.  
  10. func stopTimer()
  11. {
  12. if timer != nil {
  13. timer!.invalidate()
  14. timer = nil
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement