project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
785 stars 236 forks source link

unable to initialize class object to change password #327

Open pratap511 opened 4 years ago

pratap511 commented 4 years ago

i'm inable to initialize this class. Please help me on below snippet

            EncryptedStore *store = ******

            if([store checkAndChangeDatabasePassphrase:@"1234" toNewPassphrase:@"5678" error:nil]) {
                NSLog(@"Changed Password");
            }
dankito commented 3 years ago
if let encryptedStore = persistentContainer.persistentStoreCoordinator.persistentStores.compactMap { $0 as? EncryptedStore }.first {
     try? encryptedStore.checkAndChangeDatabasePassphrase("1234", toNewPassphrase: "5678")
}