diff --git a/pass/Controllers/AboutRepositoryTableViewController.swift b/pass/Controllers/AboutRepositoryTableViewController.swift index da01bff..1221e85 100644 --- a/pass/Controllers/AboutRepositoryTableViewController.swift +++ b/pass/Controllers/AboutRepositoryTableViewController.swift @@ -14,9 +14,18 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController { navigationItemTitle = "About Repository" super.viewDidLoad() let passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData() + let fm = FileManager.default + var size = UInt64(0) + do { + size = try fm.allocatedSizeOfDirectoryAtURL(directoryURL: PasswordStore.shared.storeURL) + } catch { + print(error) + } + let formatted = ByteCountFormatter.string(fromByteCount: Int64(size), countStyle: ByteCountFormatter.CountStyle.file) tableData = [ // section 0 [[.type: CellDataType.detail, .title: "Passwords", .detailText: String(passwordEntities.count)], + [.type: CellDataType.detail, .title: "Size", .detailText: formatted], [.type: CellDataType.detail, .title: "Last Updated", .detailText: Utils.getLastUpdatedTimeString()], ], ]