diff --git a/BeeKit/Model/DataPoint.swift b/BeeKit/Model/DataPoint.swift index 0bed5d4ec..0c8e6f9e9 100644 --- a/BeeKit/Model/DataPoint.swift +++ b/BeeKit/Model/DataPoint.swift @@ -60,7 +60,7 @@ public class DataPoint: NSManagedObject, DataPointProtocol { /// Produce a DataPoint matching the supplied JSON, either creating a new one or re-using an existing object in the datastore public static func fromJSON(context: NSManagedObjectContext, goal: Goal, json: JSON) -> DataPoint { // Check for an existing datapoint with the relevant ID, if so use it - let id = json["id"].stringValue + let id = json["id"].string! let fetchRequest = NSFetchRequest(entityName: "DataPoint") fetchRequest.predicate = NSPredicate(format: "id == %@", id) diff --git a/BeeKit/Model/Goal.swift b/BeeKit/Model/Goal.swift index cb6198609..3ac2539f1 100644 --- a/BeeKit/Model/Goal.swift +++ b/BeeKit/Model/Goal.swift @@ -122,7 +122,7 @@ public class Goal: NSManagedObject, GoalProtocol { let entity = NSEntityDescription.entity(forEntityName: "Goal", in: context)! super.init(entity: entity, insertInto: context) self.owner = owner - self.id = json["id"].stringValue + self.id = json["id"].string! self.updateToMatch(json: json) } @@ -143,7 +143,7 @@ public class Goal: NSManagedObject, GoalProtocol { // Question: Should this type know about JSON, or should there be an adapter / extension? public func updateToMatch(json: JSON) { - self.slug = json["slug"].stringValue + self.slug = json["slug"].string! self.alertStart = json["alertstart"].intValue self.autodata = json["autodata"].string