Closed DedicatedDev closed 3 years ago
func saveWordToDB(with savedWord:SavedWord)->Future<Bool,Error>{ return Future<Bool,Error> { promise in let dbQuery = "INSERT INTO SAVEDWORDS VALUES(\"(savedWord.word!)\",\"(savedWord.date!)\")" do { try self.database.run(dbQuery) promise(.success(true)) }catch{ print(error.localizedDescription) promise(.failure(error)) } } }
this code is working very well in simulator but not working in real device. not sure why this is happened.
repeated question. you can't use bundle resource.
just solved my problem. thanks.
func saveWordToDB(with savedWord:SavedWord)->Future<Bool,Error>{ return Future<Bool,Error> { promise in let dbQuery = "INSERT INTO SAVEDWORDS VALUES(\"(savedWord.word!)\",\"(savedWord.date!)\")" do { try self.database.run(dbQuery) promise(.success(true)) }catch{ print(error.localizedDescription) promise(.failure(error)) } } }
this code is working very well in simulator but not working in real device. not sure why this is happened.