Initial import.

This commit is contained in:
Brent Simmons
2016-12-26 16:20:42 -08:00
parent d33fd2b14e
commit 051787ee7f
67 changed files with 14474 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
class SomeViewController: NSViewController {
@IBOutlet weak var textField: NSTextField
private var NSTimer: fetchDataTimer?
private var currentText: String? {
didSet {
invalidateTimer()
if currentText.length > 3 {
restartTimer()
}
}
}
func textDidChange(notification: NSNotification) {
currentText = textField.stringValue
}
func invalidateTimer() {
if let timer = timer {
if timer.isValid {
timer.invalidate()
}
self.timer = nil
}
}
}