Fix for puller
This commit is contained in:
parent
5be64456c3
commit
f4b5b7d328
@ -1136,7 +1136,7 @@
|
|||||||
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 = 102;
|
CURRENT_PROJECT_VERSION = 103;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
@ -1161,7 +1161,7 @@
|
|||||||
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 = 102;
|
CURRENT_PROJECT_VERSION = 103;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
|
|||||||
@ -34,7 +34,8 @@ class MainTabController: UITabBarController, UITabBarControllerDelegate {
|
|||||||
attributes.screenBackground = .color(color: EKColor(UIColor(white: 0, alpha: 0.7)))
|
attributes.screenBackground = .color(color: EKColor(UIColor(white: 0, alpha: 0.7)))
|
||||||
attributes.roundCorners = .top(radius: 24)
|
attributes.roundCorners = .top(radius: 24)
|
||||||
attributes.screenInteraction = .dismiss
|
attributes.screenInteraction = .dismiss
|
||||||
attributes.entryInteraction = .forward
|
attributes.scroll = .disabled
|
||||||
|
attributes.entryInteraction = .absorbTouches
|
||||||
attributes.entranceAnimation = .init(translate: .init(duration: 0.2))
|
attributes.entranceAnimation = .init(translate: .init(duration: 0.2))
|
||||||
attributes.exitAnimation = .init(translate: .init(duration: 0.2))
|
attributes.exitAnimation = .init(translate: .init(duration: 0.2))
|
||||||
|
|
||||||
|
|||||||
@ -233,6 +233,14 @@ class NotesController: UIViewController, UITableViewDataSource, UITableViewDeleg
|
|||||||
// MARK: - Utils
|
// MARK: - Utils
|
||||||
|
|
||||||
func showAddNoteAlert(text: String?, completion: @escaping (String) -> Void) {
|
func showAddNoteAlert(text: String?, completion: @escaping (String) -> Void) {
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
showAddNoteAlertCatalyst(text: text, completion: completion)
|
||||||
|
#else
|
||||||
|
showAddNoteAlertIos(text: text, completion: completion)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
func showAddNoteAlertIos(text: String?, completion: @escaping (String) -> Void) {
|
||||||
let alertController = UIAlertController(title: NSLocalizedString("New note", comment: ""), message: nil, preferredStyle: .alert)
|
let alertController = UIAlertController(title: NSLocalizedString("New note", comment: ""), message: nil, preferredStyle: .alert)
|
||||||
|
|
||||||
let cancelAction = UIAlertAction.init(title: NSLocalizedString("Cancel", comment: ""), style: .default)
|
let cancelAction = UIAlertAction.init(title: NSLocalizedString("Cancel", comment: ""), style: .default)
|
||||||
@ -265,4 +273,23 @@ class NotesController: UIViewController, UITableViewDataSource, UITableViewDeleg
|
|||||||
@objc func tapDone(sender: Any) {
|
@objc func tapDone(sender: Any) {
|
||||||
self.textView.endEditing(true)
|
self.textView.endEditing(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func showAddNoteAlertCatalyst(text: String?, completion: @escaping (String) -> Void) {
|
||||||
|
let alertController = UIAlertController(title: NSLocalizedString("New note", comment: ""), message: nil, preferredStyle: .alert)
|
||||||
|
|
||||||
|
let cancelAction = UIAlertAction.init(title: NSLocalizedString("Cancel", comment: ""), style: .default)
|
||||||
|
alertController.addAction(cancelAction)
|
||||||
|
|
||||||
|
let saveAction = UIAlertAction(title: NSLocalizedString("Done", comment: ""), style: .default) { (action) in
|
||||||
|
let enteredText = alertController.textFields?.first?.text ?? ""
|
||||||
|
completion(enteredText)
|
||||||
|
}
|
||||||
|
alertController.addAction(saveAction)
|
||||||
|
|
||||||
|
alertController.addTextField { textField in
|
||||||
|
textField.text = text
|
||||||
|
}
|
||||||
|
|
||||||
|
self.present(alertController, animated: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,12 +163,17 @@ class RealmSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource
|
|||||||
throw CocoaError.error("Type \(Item.self) is not exportable")
|
throw CocoaError.error("Type \(Item.self) is not exportable")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var items = self.data.toArray().map { $0.clone() }
|
||||||
|
if let predicate = self.filterPredicate {
|
||||||
|
items = items.filter(predicate)
|
||||||
|
}
|
||||||
|
|
||||||
var result = ""
|
var result = ""
|
||||||
let newLine: Character = "\r\n" //"\u{000B}"
|
let newLine: Character = "\r\n" //"\u{000B}"
|
||||||
result.append(type.csvHeader)
|
result.append(type.csvHeader)
|
||||||
result.append(newLine)
|
result.append(newLine)
|
||||||
|
|
||||||
for item in self.data {
|
for item in items {
|
||||||
if let exportableItem = item as? Exportable {
|
if let exportableItem = item as? Exportable {
|
||||||
result.append(exportableItem.csvLine)
|
result.append(exportableItem.csvLine)
|
||||||
result.append(newLine)
|
result.append(newLine)
|
||||||
|
|||||||
@ -364,7 +364,7 @@ public class Vehicle: Object, Decodable, Identifiable, Differentiable, Cloneable
|
|||||||
// MARK: - Exportable
|
// MARK: - Exportable
|
||||||
|
|
||||||
public static var csvHeader: String {
|
public static var csvHeader: String {
|
||||||
return "Plate Number, Model, Color, Year, Owners, VIN, STS, PTS, Added Date, Updated date, Locations, Notes"
|
return "Plate Number, Model, Color, Year, Power (HP), Events, Owners, VIN, STS, PTS, Added Date, Updated date, Locations, Notes"
|
||||||
}
|
}
|
||||||
|
|
||||||
public var csvLine: String {
|
public var csvLine: String {
|
||||||
@ -383,11 +383,15 @@ public class Vehicle: Object, Decodable, Identifiable, Differentiable, Cloneable
|
|||||||
partialResult + note.text + "\r\n"
|
partialResult + note.text + "\r\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
return String(format: "%@, \"%@\", %@, %d, %d, %@, %@, %@, \"%@\", \"%@\", \"%@\", \"%@\"",
|
let number = self.currentNumber == nil ? self.number : "\(self.number) (\(self.currentNumber ?? ""))"
|
||||||
self.number,
|
|
||||||
|
return String(format: "%@, \"%@\", %@, %d, %f, %d, %d, %@, %@, %@, \"%@\", \"%@\", \"%@\", \"%@\"",
|
||||||
|
number,
|
||||||
model,
|
model,
|
||||||
self.color ?? "",
|
self.color ?? "",
|
||||||
self.year,
|
self.year,
|
||||||
|
self.engine?.powerHp ?? 0.0,
|
||||||
|
self.events.count,
|
||||||
self.ownershipPeriods.count,
|
self.ownershipPeriods.count,
|
||||||
self.vin1 ?? "",
|
self.vin1 ?? "",
|
||||||
self.sts ?? "",
|
self.sts ?? "",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user