From ee48f01a5ffb90a246cad2e9ba08498de505c328 Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Mon, 1 Jun 2020 15:46:23 +0300 Subject: [PATCH] Fixed crash --- AutoCat.xcodeproj/project.pbxproj | 4 ++-- AutoCat/Controllers/CheckController.swift | 2 +- AutoCat/ThirdParty/Api.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AutoCat.xcodeproj/project.pbxproj b/AutoCat.xcodeproj/project.pbxproj index 0b54a89..1bb90c5 100644 --- a/AutoCat.xcodeproj/project.pbxproj +++ b/AutoCat.xcodeproj/project.pbxproj @@ -603,7 +603,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -625,7 +625,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/AutoCat/Controllers/CheckController.swift b/AutoCat/Controllers/CheckController.swift index 3c87d72..b67e949 100644 --- a/AutoCat/Controllers/CheckController.swift +++ b/AutoCat/Controllers/CheckController.swift @@ -92,7 +92,7 @@ class CheckController: UIViewController, MaskedTextFieldDelegateListener, UITabl .subscribe(onNext: onReceivedVehicle(_:), onError: { err in if let realm = try? Realm() { try? realm.write { - realm.add(Vehicle(numberNormalized)) + realm.add(Vehicle(numberNormalized), update: .modified) } } IHProgressHUD.showError(withStatus: err.localizedDescription) diff --git a/AutoCat/ThirdParty/Api.swift b/AutoCat/ThirdParty/Api.swift index 5a7ded9..078bf3d 100644 --- a/AutoCat/ThirdParty/Api.swift +++ b/AutoCat/ThirdParty/Api.swift @@ -7,7 +7,7 @@ class Api { } private static func createRequest(api: String, method: String, body: [String: T]? = nil) -> URLRequest? where T: LosslessStringConvertible { - guard var urlComponents = URLComponents(string: Constants.baseUrl + api) else { return nil } + guard var urlComponents = URLComponents(string: Constants.debugBaseUrl + api) else { return nil } if let body = body, method.uppercased() == "GET" { urlComponents.queryItems = body.map { URLQueryItem(name: $0, value: String($1)) }