diff --git a/Mist/Extensions/Double+Extension.swift b/Mist/Extensions/Double+Extension.swift index eb099eb..aaef4c0 100644 --- a/Mist/Extensions/Double+Extension.swift +++ b/Mist/Extensions/Double+Extension.swift @@ -17,13 +17,13 @@ extension Double { func bytesString() -> String { if self < .kilobyte { - return "\(Int(self)) bytes" + "\(Int(self)) bytes" } else if self < .megabyte { - return String(format: "%5.2f KB", self / .kilobyte) + String(format: "%5.2f KB", self / .kilobyte) } else if self < .gigabyte { - return String(format: "%5.2f MB", self / .megabyte) + String(format: "%5.2f MB", self / .megabyte) } else { - return String(format: "%5.2f GB", self / .gigabyte) + String(format: "%5.2f GB", self / .gigabyte) } } } diff --git a/Mist/Extensions/Scene+Extension.swift b/Mist/Extensions/Scene+Extension.swift index 81d4472..c5a98b0 100644 --- a/Mist/Extensions/Scene+Extension.swift +++ b/Mist/Extensions/Scene+Extension.swift @@ -10,9 +10,9 @@ import SwiftUI extension Scene { func fixedWindow() -> some Scene { if #available(macOS 13.0, *) { - return self.windowResizability(.contentSize) + self.windowResizability(.contentSize) } else { - return self + self } } } diff --git a/Mist/Extensions/UInt64+Extension.swift b/Mist/Extensions/UInt64+Extension.swift index ff55053..733c123 100644 --- a/Mist/Extensions/UInt64+Extension.swift +++ b/Mist/Extensions/UInt64+Extension.swift @@ -17,13 +17,13 @@ extension UInt64 { func bytesString() -> String { if self < .kilobyte { - return "\(self) bytes" + "\(self) bytes" } else if self < .megabyte { - return String(format: "%5.2f KB", Double(self) / Double(.kilobyte)) + String(format: "%5.2f KB", Double(self) / Double(.kilobyte)) } else if self < .gigabyte { - return String(format: "%5.2f MB", Double(self) / Double(.megabyte)) + String(format: "%5.2f MB", Double(self) / Double(.megabyte)) } else { - return String(format: "%5.2f GB", Double(self) / Double(.gigabyte)) + String(format: "%5.2f GB", Double(self) / Double(.gigabyte)) } } diff --git a/Mist/Model/Architecture.swift b/Mist/Model/Architecture.swift index 6c59185..77fb6fa 100644 --- a/Mist/Model/Architecture.swift +++ b/Mist/Model/Architecture.swift @@ -18,9 +18,9 @@ enum Architecture: String { var description: String { switch self { case .appleSilicon: - return "Apple Silicon" + "Apple Silicon" case .intel: - return "Intel-based" + "Intel-based" } } } diff --git a/Mist/Model/CatalogType.swift b/Mist/Model/CatalogType.swift index 0e52021..10f43b5 100644 --- a/Mist/Model/CatalogType.swift +++ b/Mist/Model/CatalogType.swift @@ -22,13 +22,13 @@ enum CatalogType: String, CaseIterable, Comparable, Decodable { private var sortOrder: Int { switch self { case .sonoma: - return 0 + 0 case .ventura: - return 1 + 1 case .monterey: - return 2 + 2 case .bigSur: - return 3 + 3 } } @@ -42,52 +42,52 @@ enum CatalogType: String, CaseIterable, Comparable, Decodable { case .sonoma: switch seedType { case .standard: - return "https://swscan.apple.com/content/catalogs/others/index-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .customer: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-14customerseed-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-14customerseed-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .developer: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-14seed-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-14seed-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .public: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-14beta-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-14beta-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" } case .ventura: switch seedType { case .standard: - return "https://swscan.apple.com/content/catalogs/others/index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .customer: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-13customerseed-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-13customerseed-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .developer: - return "https://swscan.apple.com/content/catalogs/others/index-13seed-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-13seed-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .public: - return "https://swscan.apple.com/content/catalogs/others/index-13beta-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-13beta-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" } case .monterey: switch seedType { case .standard: - return "https://swscan.apple.com/content/catalogs/others/index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .customer: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-12customerseed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-12customerseed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .developer: - return "https://swscan.apple.com/content/catalogs/others/index-12seed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-12seed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .public: - return "https://swscan.apple.com/content/catalogs/others/index-12beta-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-12beta-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" } case .bigSur: switch seedType { case .standard: - return "https://swscan.apple.com/content/catalogs/others/index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .customer: // swiftlint:disable:next line_length - return "https://swscan.apple.com/content/catalogs/others/index-10.16customerseed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-10.16customerseed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .developer: - return "https://swscan.apple.com/content/catalogs/others/index-10.16seed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-10.16seed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" case .public: - return "https://swscan.apple.com/content/catalogs/others/index-10.16beta-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + "https://swscan.apple.com/content/catalogs/others/index-10.16beta-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" } } } diff --git a/Mist/Model/ExportListType.swift b/Mist/Model/ExportListType.swift index 6e91bc9..1662ee7 100644 --- a/Mist/Model/ExportListType.swift +++ b/Mist/Model/ExportListType.swift @@ -20,26 +20,26 @@ enum ExportListType: String, CaseIterable, Identifiable { var description: String { switch self { case .csv: - return "CSV (Comma Separated Values)" + "CSV (Comma Separated Values)" case .json: - return "JSON (JavaScript Object Notation)" + "JSON (JavaScript Object Notation)" case .plist: - return "Plist (Apple Property List)" + "Plist (Apple Property List)" case .yaml: - return "YAML (YAML Ain't Markup Language)" + "YAML (YAML Ain't Markup Language)" } } var contentType: UTType { switch self { case .csv: - return .commaSeparatedText + .commaSeparatedText case .json: - return .json + .json case .plist: - return .propertyList + .propertyList case .yaml: - return .yaml + .yaml } } } diff --git a/Mist/Model/Hardware.swift b/Mist/Model/Hardware.swift index 3aabdb0..b3ee3a7 100644 --- a/Mist/Model/Hardware.swift +++ b/Mist/Model/Hardware.swift @@ -29,11 +29,11 @@ enum Hardware { static var deviceID: String? { switch architecture { case .appleSilicon: - return registryProperty(for: "compatible")?.components(separatedBy: "\0").first?.uppercased() + registryProperty(for: "compatible")?.components(separatedBy: "\0").first?.uppercased() case .intel: - return registryProperty(for: "bridge-model")?.uppercased() + registryProperty(for: "bridge-model")?.uppercased() default: - return nil + nil } } diff --git a/Mist/Model/InstallerExportType.swift b/Mist/Model/InstallerExportType.swift index a861f54..01d9675 100644 --- a/Mist/Model/InstallerExportType.swift +++ b/Mist/Model/InstallerExportType.swift @@ -22,13 +22,13 @@ enum InstallerExportType: String, CaseIterable, Identifiable { var systemName: String { switch self { case .application: - return "macwindow" + "macwindow" case .diskImage: - return "opticaldiscdrive" + "opticaldiscdrive" case .iso: - return "opticaldisc" + "opticaldisc" case .package: - return "shippingbox" + "shippingbox" } } } diff --git a/Mist/Model/MistTaskState.swift b/Mist/Model/MistTaskState.swift index 58dc3c0..7e94f6c 100644 --- a/Mist/Model/MistTaskState.swift +++ b/Mist/Model/MistTaskState.swift @@ -16,26 +16,26 @@ enum MistTaskState: String { var imageName: String { switch self { case .pending: - return "hourglass.circle.fill" + "hourglass.circle.fill" case .inProgress: - return "gear.circle.fill" + "gear.circle.fill" case .complete: - return "checkmark.circle.fill" + "checkmark.circle.fill" case .error: - return "xmark.circle.fill" + "xmark.circle.fill" } } var color: Color { switch self { case .pending: - return .orange + .orange case .inProgress: - return .blue + .blue case .complete: - return .green + .green case .error: - return .red + .red } } } diff --git a/Mist/Model/RefreshState.swift b/Mist/Model/RefreshState.swift index 7bd62cb..53a5cc6 100644 --- a/Mist/Model/RefreshState.swift +++ b/Mist/Model/RefreshState.swift @@ -21,30 +21,30 @@ enum RefreshState: String, CaseIterable, Identifiable { var systemName: String { switch self { case .pending: - return "hourglass.circle.fill" + "hourglass.circle.fill" case .inProgress: - return "gear.circle.fill" + "gear.circle.fill" case .complete: - return "checkmark.circle.fill" + "checkmark.circle.fill" case .warning: - return "exclamationmark.triangle.fill" + "exclamationmark.triangle.fill" case .error: - return "x.circle.fill" + "x.circle.fill" } } var color: Color { switch self { case .pending: - return .orange + .orange case .inProgress: - return .blue + .blue case .complete: - return .green + .green case .warning: - return .yellow + .yellow case .error: - return .red + .red } } } diff --git a/Mist/Views/Activity/ActivityView.swift b/Mist/Views/Activity/ActivityView.swift index 87cbbd3..dc1fb36 100644 --- a/Mist/Views/Activity/ActivityView.swift +++ b/Mist/Views/Activity/ActivityView.swift @@ -46,9 +46,9 @@ struct ActivityView: View { private var buttonText: String { switch taskManager.currentState { case .pending, .inProgress: - return "Cancel" + "Cancel" case .complete, .error: - return "Close" + "Close" } } @@ -111,14 +111,14 @@ struct ActivityView: View { .alert(isPresented: $showAlert) { switch alertType { case .cancel: - return Alert( + Alert( title: Text("Are you sure you want to cancel?"), message: Text("This process cannot be resumed once it has been cancelled."), primaryButton: .default(Text("Resume")), secondaryButton: .destructive(Text("Cancel"), action: { cancel() }) ) case .error: - return Alert( + Alert( title: Text("An error has occurred!"), message: Text(error?.description ?? ""), dismissButton: .default(Text("OK")) diff --git a/Mist/Views/List/ListRowFirmware.swift b/Mist/Views/List/ListRowFirmware.swift index 49fb6aa..405dc36 100644 --- a/Mist/Views/List/ListRowFirmware.swift +++ b/Mist/Views/List/ListRowFirmware.swift @@ -67,21 +67,21 @@ struct ListRowFirmware: View { .alert(isPresented: $showAlert) { switch alertType { case .compatibility: - return Alert( + Alert( title: Text("macOS Firmware not compatible!"), message: Text(compatibilityMessage), primaryButton: .default(Text("Cancel")), secondaryButton: .default(Text("Continue")) { Task { validate() } } ) case .helperTool: - return Alert( + Alert( title: Text("Privileged Helper Tool not installed!"), message: Text("The Mist Privileged Helper Tool is required to perform Administrator tasks when downloading macOS Firmwares."), primaryButton: .default(Text("Install...")) { Task { installPrivilegedHelperTool() } }, secondaryButton: .default(Text("Cancel")) ) case .error: - return Alert( + Alert( title: Text("An error has occured!"), message: Text(errorMessage), dismissButton: .default(Text("OK")) diff --git a/Mist/Views/List/ListRowInstaller.swift b/Mist/Views/List/ListRowInstaller.swift index acaad84..5d97d5b 100644 --- a/Mist/Views/List/ListRowInstaller.swift +++ b/Mist/Views/List/ListRowInstaller.swift @@ -312,35 +312,35 @@ struct ListRowInstaller: View { private func alert(for alertType: InstallerAlertType) -> Alert { switch alertType { case .compatibility: - return Alert( + Alert( title: Text("macOS Installer not compatible!"), message: Text(compatibilityMessage), primaryButton: .default(Text("Cancel")), secondaryButton: .default(Text("Continue")) { Task { validate() } } ) case .helperTool: - return Alert( + Alert( title: Text("Privileged Helper Tool not installed!"), message: Text("The Mist Privileged Helper Tool is required to perform Administrator tasks when creating macOS Installers."), primaryButton: .default(Text("Install...")) { Task { installPrivilegedHelperTool() } }, secondaryButton: .default(Text("Cancel")) ) case .fullDiskAccess: - return Alert( + Alert( title: Text("Full Disk Access required!"), message: Text("Mist requires Full Disk Access to perform Administrator tasks when creating macOS Installers."), primaryButton: .default(Text("Allow...")) { openFullDiskAccessPreferences() }, secondaryButton: .default(Text("Cancel")) ) case .cacheDirectory: - return Alert( + Alert( title: Text("Cache directory settings incorrect!"), message: Text(cacheDirectoryMessage), primaryButton: .default(Text("Repair...")) { Task { try await repairCacheDirectoryOwnershipAndPermissions() } }, secondaryButton: .default(Text("Cancel")) ) case .error: - return Alert( + Alert( title: Text("An error has occured!"), message: Text(errorMessage), dismissButton: .default(Text("OK")) diff --git a/Mist/Views/Settings/SettingsInstallersCacheView.swift b/Mist/Views/Settings/SettingsInstallersCacheView.swift index 449a6c2..3fced9f 100644 --- a/Mist/Views/Settings/SettingsInstallersCacheView.swift +++ b/Mist/Views/Settings/SettingsInstallersCacheView.swift @@ -64,7 +64,7 @@ struct SettingsInstallersCacheView: View { .alert(isPresented: $showAlert) { switch alertType { case .confirmation: - return Alert( + Alert( title: Text("Remove Cached Installer?"), message: Text(removalMessage), primaryButton: .cancel(), @@ -76,7 +76,7 @@ struct SettingsInstallersCacheView: View { } ) case .error: - return Alert( + Alert( title: Text("An error has occured!"), message: Text("There was an error removing the cached Installer directory. Show in Finder to remove manually."), primaryButton: .default(Text("OK")) { }, diff --git a/Mist/Views/Settings/SettingsInstallersCatalogsView.swift b/Mist/Views/Settings/SettingsInstallersCatalogsView.swift index 81ae4ac..32c4879 100644 --- a/Mist/Views/Settings/SettingsInstallersCatalogsView.swift +++ b/Mist/Views/Settings/SettingsInstallersCatalogsView.swift @@ -51,13 +51,13 @@ struct SettingsInstallersCatalogsView: View { get: { switch catalogSeedType { case .standard: - return catalog.standard + catalog.standard case .customer: - return catalog.customerSeed + catalog.customerSeed case .developer: - return catalog.developerSeed + catalog.developerSeed case .public: - return catalog.publicSeed + catalog.publicSeed } }, set: {