Created
June 16, 2014 12:36
-
-
Save tonyarnold/30f56a2ccf88592373af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class ViewModel: NSObject | |
{ | |
struct SerializationKey | |
{ | |
static let query = "query" | |
static let hasValidValues = "hasValidValues" | |
} | |
var query: String = "" | |
{ | |
willSet | |
{ | |
self.willChangeValueForKey(SerializationKey.hasValidValues) | |
} | |
didSet | |
{ | |
self.didChangeValueForKey(SerializationKey.hasValidValues) | |
} | |
} | |
var hasValidValues: Bool | |
{ | |
return !query.isEmpty | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment