diff --git a/AutoCat.xcodeproj/project.pbxproj b/AutoCat.xcodeproj/project.pbxproj index 0226fb0..62d14a3 100644 --- a/AutoCat.xcodeproj/project.pbxproj +++ b/AutoCat.xcodeproj/project.pbxproj @@ -847,7 +847,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 65; + CURRENT_PROJECT_VERSION = 66; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -870,7 +870,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 65; + CURRENT_PROJECT_VERSION = 66; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/AutoCat/AppDelegate.swift b/AutoCat/AppDelegate.swift index d059df4..634206d 100644 --- a/AutoCat/AppDelegate.swift +++ b/AutoCat/AppDelegate.swift @@ -25,7 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let config = Realm.Configuration( - schemaVersion: 29, + schemaVersion: 32, migrationBlock: { migration, oldSchemaVersion in if oldSchemaVersion <= 3 { var numbers: [String] = [] @@ -110,6 +110,28 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } } + + if oldSchemaVersion <= 31 { + migration.enumerateObjects(ofType: "Vehicle") { old, new in + if let oldDebugInfo = old?["debugInfo"] as? DynamicObject, let newDebugInfo = new?["debugInfo"] as? DynamicObject { + let addStatus = { (providerName: String) -> Void in + if let provider = oldDebugInfo[providerName] as? DynamicObject, let newProvider = newDebugInfo[providerName] as? DynamicObject { + if provider["error"] != nil { + newProvider["status"] = DebugInfoStatus.error.rawValue + } else { + newProvider["status"] = DebugInfoStatus.success.rawValue + } + } + } + + addStatus("autocod") + addStatus("vin01vin") + addStatus("vin01base") + addStatus("vin01history") + addStatus("nomerogram") + } + } + } }) Realm.Configuration.defaultConfiguration = config diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png deleted file mode 100644 index 3719abf..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-120.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-120.png deleted file mode 100644 index ed47045..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-120.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-121.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-121.png deleted file mode 100644 index ed47045..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-121.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-152.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-152.png deleted file mode 100644 index ea33e7f..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-152.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-167.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-167.png deleted file mode 100644 index 680767d..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-167.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-180.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-180.png deleted file mode 100644 index 9c2c151..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-180.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-20.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-20.png deleted file mode 100644 index d27b8dc..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-20.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png deleted file mode 100644 index a7d5071..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-40.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-40.png deleted file mode 100644 index 4594725..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-40.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-41.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-41.png deleted file mode 100644 index 4594725..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-41.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-42.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-42.png deleted file mode 100644 index 4594725..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-42.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-58.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-58.png deleted file mode 100644 index 518cee2..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-58.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-59.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-59.png deleted file mode 100644 index 518cee2..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-59.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-60.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-60.png deleted file mode 100644 index e5ca11e..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-60.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-76.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-76.png deleted file mode 100644 index ae1c073..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-76.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-80.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-80.png deleted file mode 100644 index d9eaf93..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-80.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-81.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-81.png deleted file mode 100644 index d9eaf93..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-81.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-87.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-87.png deleted file mode 100644 index 973e4be..0000000 Binary files a/AutoCat/Assets.xcassets/AppIcon.appiconset/AppIcon-87.png and /dev/null differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/Contents.json b/AutoCat/Assets.xcassets/AppIcon.appiconset/Contents.json index 18952bb..3d9d3eb 100644 --- a/AutoCat/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/AutoCat/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,116 +1,116 @@ { "images" : [ { - "size" : "20x20", + "filename" : "wheel-40.png", "idiom" : "iphone", - "filename" : "AppIcon-40.png", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { - "size" : "20x20", + "filename" : "wheel-60.png", "idiom" : "iphone", - "filename" : "AppIcon-60.png", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { - "size" : "29x29", + "filename" : "wheel-58.png", "idiom" : "iphone", - "filename" : "AppIcon-58.png", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { - "size" : "29x29", + "filename" : "wheel-87.png", "idiom" : "iphone", - "filename" : "AppIcon-87.png", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { - "size" : "40x40", + "filename" : "wheel-80.png", "idiom" : "iphone", - "filename" : "AppIcon-80.png", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { - "size" : "40x40", + "filename" : "wheel-120.png", "idiom" : "iphone", - "filename" : "AppIcon-120.png", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" }, { - "size" : "60x60", + "filename" : "wheel-121.png", "idiom" : "iphone", - "filename" : "AppIcon-121.png", - "scale" : "2x" + "scale" : "2x", + "size" : "60x60" }, { - "size" : "60x60", + "filename" : "wheel-180.png", "idiom" : "iphone", - "filename" : "AppIcon-180.png", - "scale" : "3x" + "scale" : "3x", + "size" : "60x60" }, { - "size" : "20x20", + "filename" : "wheel-20.png", "idiom" : "ipad", - "filename" : "AppIcon-20.png", - "scale" : "1x" + "scale" : "1x", + "size" : "20x20" }, { - "size" : "20x20", + "filename" : "wheel-41.png", "idiom" : "ipad", - "filename" : "AppIcon-41.png", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { - "size" : "29x29", + "filename" : "wheel-29.png", "idiom" : "ipad", - "filename" : "AppIcon-29.png", - "scale" : "1x" + "scale" : "1x", + "size" : "29x29" }, { - "size" : "29x29", + "filename" : "wheel-59.png", "idiom" : "ipad", - "filename" : "AppIcon-59.png", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { - "size" : "40x40", + "filename" : "wheel-42.png", "idiom" : "ipad", - "filename" : "AppIcon-42.png", - "scale" : "1x" + "scale" : "1x", + "size" : "40x40" }, { - "size" : "40x40", + "filename" : "wheel-81.png", "idiom" : "ipad", - "filename" : "AppIcon-81.png", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { - "size" : "76x76", + "filename" : "wheel-76.png", "idiom" : "ipad", - "filename" : "AppIcon-76.png", - "scale" : "1x" + "scale" : "1x", + "size" : "76x76" }, { - "size" : "76x76", + "filename" : "wheel-152.png", "idiom" : "ipad", - "filename" : "AppIcon-152.png", - "scale" : "2x" + "scale" : "2x", + "size" : "76x76" }, { - "size" : "83.5x83.5", + "filename" : "wheel-167.png", "idiom" : "ipad", - "filename" : "AppIcon-167.png", - "scale" : "2x" + "scale" : "2x", + "size" : "83.5x83.5" }, { - "size" : "1024x1024", + "filename" : "wheel-1024.png", "idiom" : "ios-marketing", - "filename" : "AppIcon-1024.png", - "scale" : "1x" + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-1024.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-1024.png new file mode 100644 index 0000000..2ff9d7e Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-1024.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-120.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-120.png new file mode 100644 index 0000000..a34344e Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-120.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-121.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-121.png new file mode 100644 index 0000000..a34344e Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-121.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-152.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-152.png new file mode 100644 index 0000000..08ce6d3 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-152.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-167.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-167.png new file mode 100644 index 0000000..afd9d8f Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-167.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-180.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-180.png new file mode 100644 index 0000000..d7c3b71 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-180.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-20.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-20.png new file mode 100644 index 0000000..5e7d10a Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-20.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-29.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-29.png new file mode 100644 index 0000000..d486aef Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-29.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-40.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-40.png new file mode 100644 index 0000000..3deb29b Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-40.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-41.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-41.png new file mode 100644 index 0000000..3deb29b Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-41.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-42.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-42.png new file mode 100644 index 0000000..3deb29b Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-42.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-58.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-58.png new file mode 100644 index 0000000..f5785d7 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-58.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-59.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-59.png new file mode 100644 index 0000000..f5785d7 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-59.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-60.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-60.png new file mode 100644 index 0000000..91bd09b Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-60.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-76.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-76.png new file mode 100644 index 0000000..9b3cd8a Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-76.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-80.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-80.png new file mode 100644 index 0000000..a7ee4c7 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-80.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-81.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-81.png new file mode 100644 index 0000000..a7ee4c7 Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-81.png differ diff --git a/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-87.png b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-87.png new file mode 100644 index 0000000..c5ba31c Binary files /dev/null and b/AutoCat/Assets.xcassets/AppIcon.appiconset/wheel-87.png differ diff --git a/AutoCat/Controllers/CheckController.swift b/AutoCat/Controllers/CheckController.swift index 6867c6d..9fe73f9 100644 --- a/AutoCat/Controllers/CheckController.swift +++ b/AutoCat/Controllers/CheckController.swift @@ -299,7 +299,7 @@ class CheckController: UIViewController, UITableViewDelegate, UITextFieldDelegat return Single.just(event) } - if let event = LocationManager.lastEvent, (Date().timeIntervalSince1970 - event.date) < 60 { + if let event = LocationManager.lastEvent, (Date().timeIntervalSince1970 - event.date) < 15 { return Single.just(event) } else { return LocationManager.requestCurrentLocation() diff --git a/AutoCat/Models/DebugInfo.swift b/AutoCat/Models/DebugInfo.swift index 9c0497d..ad25794 100644 --- a/AutoCat/Models/DebugInfo.swift +++ b/AutoCat/Models/DebugInfo.swift @@ -1,6 +1,12 @@ import Foundation import RealmSwift +enum DebugInfoStatus: Int { + case success = 0 + case error = 1 + case warning = 2 +} + class DebugInfo: Object, Decodable { @objc dynamic var autocod: DebugInfoEntry! @objc dynamic var vin01vin: DebugInfoEntry! @@ -12,4 +18,10 @@ class DebugInfo: Object, Decodable { class DebugInfoEntry: Object, Decodable { @objc dynamic var fields: Int64 = 0 @objc dynamic var error: String? + @objc dynamic var status: Int = 0 + + var statusEnum: DebugInfoStatus { + get { DebugInfoStatus(rawValue: self.status)! } + set { self.status = newValue.rawValue } + } } diff --git a/AutoCat/Views/eureka/SourceStatusRow.swift b/AutoCat/Views/eureka/SourceStatusRow.swift index 141a449..690530b 100644 --- a/AutoCat/Views/eureka/SourceStatusRow.swift +++ b/AutoCat/Views/eureka/SourceStatusRow.swift @@ -1,6 +1,16 @@ import UIKit import Eureka +extension DebugInfoStatus { + var color: UIColor { + switch self { + case .success: return .systemGreen + case .error: return .systemRed + case .warning: return .systemOrange + } + } +} + class SourceStatusCell: Cell, CellType { private var circle: UIImageView! @@ -32,7 +42,7 @@ class SourceStatusCell: Cell, CellType { self.detailTextLabel?.text = nil if let value = row.value { - self.circle.tintColor = value.error == nil ? .systemGreen : .systemRed + self.circle.tintColor = value.statusEnum.color //self.accessoryType = value.error == nil ? .none : .disclosureIndicator } else { self.circle.tintColor = .systemGray