-
Notifications
You must be signed in to change notification settings - Fork 2
Creating a model
Jeff Hurray edited this page Apr 25, 2016
·
1 revision
All models conforming to SQLiteModel have a static method called new which will create a new instance of that model and insert it into the database. Notice we don't have to set the Gross because it has a default value of 0.
let theRoom = try Movie.new([
Movie.Title <- "The Room",
Movie.ReleaseDate <- NSDate(timeIntervalSince1970: 144000)
])The
<-operator is declared inSQLite.swiftand is used to createSetters which map values to columns. More info on setters can be found here
SQLiteModel