Guest User

Untitled

a guest
Aug 26th, 2016
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. let debounceTimer : NSTimer?
  2. func test() {
  3.  
  4. if let timer = debounceTimer {
  5.  
  6. timer.invalidate()
  7.  
  8. }
  9.  
  10. debounceTimer = NSTimer(timeInterval: 0.3, target: self, selector: Selector("searchUsingAPICAll"), userInfo: nil, repeats: false)
  11.  
  12. NSRunLoop.currentRunLoop().addTimer(debounceTimer!, forMode: "NSDefaultRunLoopMode")
  13.  
  14. }
Add Comment
Please, Sign In to add comment