Polish the code about "about repository"
- Move something to PasswordStore.swift
This commit is contained in:
parent
c1bdc152c5
commit
a36bb13004
2 changed files with 24 additions and 19 deletions
|
|
@ -136,6 +136,23 @@ class PasswordStore {
|
|||
}
|
||||
|
||||
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
|
||||
|
||||
var numberOfPasswords : Int {
|
||||
return self.fetchPasswordEntityCoreData(withDir: false).count
|
||||
}
|
||||
|
||||
var sizeOfRepositoryByteCount : UInt64 {
|
||||
let fm = FileManager.default
|
||||
var size = UInt64(0)
|
||||
do {
|
||||
if fm.fileExists(atPath: self.storeURL.path) {
|
||||
size = try fm.allocatedSizeOfDirectoryAtURL(directoryURL: self.storeURL)
|
||||
}
|
||||
} catch {
|
||||
print(error)
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
|
||||
private init() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue