my question is how can I use dbaccess framework with existing sqlite database? I have "test.sqlite" file in my device's Documents folder. I even renamed it to "test.db". When I try to commit the object of my class Worker nothing happens (I don't get any errors with databaseError(error: DBError!) method).
This is how Worker.swift looks like:
@objc(Worker)
class Worker: DBObject {
dynamic var lastName: NSString?
}
This is how AppDelegate.swift looks like:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
DBAccess.setDelegate(self)
DBAccess.openDatabaseNamed("test")
var w = Worker.new()
w.lastName = "WorkerName"
w.commit()
return true
}