Adding engine number to csv export
This commit is contained in:
parent
df43b9ff7f
commit
6a9e186b10
@ -1144,15 +1144,18 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 111;
|
CURRENT_PROJECT_VERSION = 112;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0;
|
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat;
|
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
@ -1169,15 +1172,18 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 111;
|
CURRENT_PROJECT_VERSION = 112;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0;
|
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat;
|
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
|
|||||||
@ -138,7 +138,12 @@ class CheckController: UIViewController, UITableViewDelegate, UISearchResultsUpd
|
|||||||
let csvString = try self.historyDataSource.makeCsv()
|
let csvString = try self.historyDataSource.makeCsv()
|
||||||
let tmpUrl = FileManager.default.tmpUrl(name: "history", ext: "csv")
|
let tmpUrl = FileManager.default.tmpUrl(name: "history", ext: "csv")
|
||||||
try csvString.write(to: tmpUrl, atomically: true, encoding: .utf8)
|
try csvString.write(to: tmpUrl, atomically: true, encoding: .utf8)
|
||||||
|
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
self.save(file: tmpUrl)
|
||||||
|
#else
|
||||||
self.shareFile(tmpUrl)
|
self.shareFile(tmpUrl)
|
||||||
|
#endif
|
||||||
} catch {
|
} catch {
|
||||||
self.show(error: error)
|
self.show(error: error)
|
||||||
}
|
}
|
||||||
@ -199,6 +204,16 @@ class CheckController: UIViewController, UITableViewDelegate, UISearchResultsUpd
|
|||||||
self.present(activityController, animated: true)
|
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
|
// MARK: - Checking new number
|
||||||
|
|
||||||
func checkTapped(number: String) {
|
func checkTapped(number: String) {
|
||||||
|
|||||||
@ -375,7 +375,7 @@ public final class Vehicle: Object, Decodable, Identifiable, Cloneable, Exportab
|
|||||||
// MARK: - Exportable
|
// MARK: - Exportable
|
||||||
|
|
||||||
public static var csvHeader: String {
|
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 {
|
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 ?? ""))"
|
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,
|
number,
|
||||||
model,
|
model,
|
||||||
self.color ?? "",
|
self.color ?? "",
|
||||||
@ -407,6 +407,7 @@ public final class Vehicle: Object, Decodable, Identifiable, Cloneable, Exportab
|
|||||||
self.vin1 ?? "",
|
self.vin1 ?? "",
|
||||||
self.sts ?? "",
|
self.sts ?? "",
|
||||||
self.pts ?? "",
|
self.pts ?? "",
|
||||||
|
self.engine?.number ?? "",
|
||||||
added,
|
added,
|
||||||
updated,
|
updated,
|
||||||
eventsString,
|
eventsString,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user