diff --git a/AutoCat.xcodeproj/project.pbxproj b/AutoCat.xcodeproj/project.pbxproj index 536e4d6..cedb2b6 100644 --- a/AutoCat.xcodeproj/project.pbxproj +++ b/AutoCat.xcodeproj/project.pbxproj @@ -1144,15 +1144,18 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 111; + CURRENT_PROJECT_VERSION = 112; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AutoCat; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -1169,15 +1172,18 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 111; + CURRENT_PROJECT_VERSION = 112; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AutoCat; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; diff --git a/AutoCat/Controllers/CheckController.swift b/AutoCat/Controllers/CheckController.swift index c48aae7..ab13d38 100644 --- a/AutoCat/Controllers/CheckController.swift +++ b/AutoCat/Controllers/CheckController.swift @@ -138,7 +138,12 @@ class CheckController: UIViewController, UITableViewDelegate, UISearchResultsUpd let csvString = try self.historyDataSource.makeCsv() let tmpUrl = FileManager.default.tmpUrl(name: "history", ext: "csv") try csvString.write(to: tmpUrl, atomically: true, encoding: .utf8) + + #if targetEnvironment(macCatalyst) + self.save(file: tmpUrl) + #else self.shareFile(tmpUrl) + #endif } catch { self.show(error: error) } @@ -199,6 +204,16 @@ class CheckController: UIViewController, UITableViewDelegate, UISearchResultsUpd self.present(activityController, animated: true) } + func save(file url: URL) { + if #available(iOS 14, *) { + let controller = UIDocumentPickerViewController(forExporting: [url]) + self.present(controller, animated: true) + } else { + let controller = UIDocumentPickerViewController(url: url, in: .exportToService) + present(controller, animated: true) + } + } + // MARK: - Checking new number func checkTapped(number: String) { diff --git a/AutoCatCore/Models/Vehicle.swift b/AutoCatCore/Models/Vehicle.swift index 4863b1b..7225e19 100644 --- a/AutoCatCore/Models/Vehicle.swift +++ b/AutoCatCore/Models/Vehicle.swift @@ -375,7 +375,7 @@ public final class Vehicle: Object, Decodable, Identifiable, Cloneable, Exportab // MARK: - Exportable public static var csvHeader: String { - return "Plate Number, Model, Color, Year, Power (HP), Events, Owners, VIN, STS, PTS, Added Date, Updated date, Locations, Notes" + return "Plate Number, Model, Color, Year, Power (HP), Events, Owners, VIN, STS, PTS, Engine number, Added Date, Updated date, Locations, Notes" } public var csvLine: String { @@ -396,7 +396,7 @@ public final class Vehicle: Object, Decodable, Identifiable, Cloneable, Exportab let number = self.currentNumber == nil ? self.number : "\(self.number) (\(self.currentNumber ?? ""))" - return String(format: "%@, \"%@\", %@, %d, %f, %d, %d, %@, %@, %@, \"%@\", \"%@\", \"%@\", \"%@\"", + return String(format: "%@, \"%@\", %@, %d, %f, %d, %d, %@, %@, %@, %@, \"%@\", \"%@\", \"%@\", \"%@\"", number, model, self.color ?? "", @@ -407,6 +407,7 @@ public final class Vehicle: Object, Decodable, Identifiable, Cloneable, Exportab self.vin1 ?? "", self.sts ?? "", self.pts ?? "", + self.engine?.number ?? "", added, updated, eventsString,