-
Notifications
You must be signed in to change notification settings - Fork 0
/
Events.swift
32 lines (27 loc) · 916 Bytes
/
Events.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Events.swift
//
//
// Created by Paul Brenner on 7/9/15.
//
//
import Foundation
import CoreData
@objc(Events)
class Events: NSManagedObject {
// Insert code here to add functionality to your managed object subclass
class func createInManagedObjectContext(moc: NSManagedObjectContext,
controlVariable: Bool,
eventType: String,
focusEvent: NSDate,
motivationScaleValue: Int,
stanfordSleepinessValue: Int) -> Events {
let newItem = NSEntityDescription.insertNewObjectForEntityForName("Events", inManagedObjectContext: moc) as! Events
newItem.controlVariable = controlVariable
newItem.eventType = eventType
newItem.focusEvent = focusEvent
newItem.motivationScaleValue = motivationScaleValue
newItem.stanfordSleepinessValue = stanfordSleepinessValue
return newItem
}
}