Skip to content

Instantly share code, notes, and snippets.

@tonyarnold
Created June 16, 2014 12:36
Show Gist options
  • Save tonyarnold/30f56a2ccf88592373af to your computer and use it in GitHub Desktop.
Save tonyarnold/30f56a2ccf88592373af to your computer and use it in GitHub Desktop.
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