add UserDoNotDisturb to User

This commit is contained in:
nixzhu
2015-08-03 18:04:16 +08:00
parent d2a0f207ff
commit d9640af33b
2 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
setSchemaVersion(14, Realm.defaultPath, { migration, oldSchemaVersion in
setSchemaVersion(15, Realm.defaultPath, { migration, oldSchemaVersion in
// We havent migrated anything yet, so oldSchemaVersion == 0
if oldSchemaVersion < 1 {
// Nothing to do!
@@ -77,6 +77,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
}
if oldSchemaVersion < 15 {
}
})
Crashlytics.startWithAPIKey("3030ba006e21bcf8eb4a2127b6a7931ea6667486")
+10
View File
@@ -74,6 +74,14 @@ class UserSocialAccountProvider: Object {
dynamic var enabled: Bool = false
}
class UserDoNotDisturb: Object {
dynamic var isOn: Bool = false
dynamic var fromHour: Int = 22
dynamic var fromMinute: Int = 0
dynamic var toHour: Int = 7
dynamic var toMinute: Int = 30
}
class User: Object {
dynamic var userID: String = ""
dynamic var nickname: String = ""
@@ -96,6 +104,8 @@ class User: Object {
dynamic var notificationEnabled: Bool = true
dynamic var blocked: Bool = false
dynamic var doNotDisturb: UserDoNotDisturb?
let learningSkills = List<UserSkill>()
let masterSkills = List<UserSkill>()
let socialAccountProviders = List<UserSocialAccountProvider>()