From b6fe2474f5d9dc028f057ca58bcf475f1a43f08f Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 26 Jan 2022 18:14:05 +0300 Subject: [PATCH] update libraries to build with Xcode 13.1; bump version --- CHANGELOG.md | 6 +- LeadKitAdditions.podspec | 8 +- LeadKitAdditions.xcodeproj/project.pbxproj | 57 +++++++--- Podfile | 12 +- Podfile.lock | 103 +++++++++--------- .../BaseTextFieldViewModel.swift | 2 +- Sources/Classes/LoadingBarButton.swift | 4 +- .../Model/PassCodeConfiguration.swift | 2 +- .../PassCode/Model/PassCodeHolder.swift | 12 +- .../View/BasePassCodeViewController.swift | 5 +- .../ViewModel/BasePassCodeViewModel.swift | 37 +++---- .../Error+NetworkingExtensions.swift | 2 +- .../Extensions/UserDefaults+UserService.swift | 4 +- Sources/Services/BasePassCodeService.swift | 10 +- Sources/Services/BaseUserService.swift | 3 +- Sources/Services/BiometricsService.swift | 4 +- .../ValidationService/ValidationItem.swift | 14 +-- .../ValidationService/ValidationService.swift | 16 ++- build-scripts | 2 +- run_swiftlint.sh | 2 +- 20 files changed, 172 insertions(+), 133 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a887fe7..23745b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ # Changelog +### 0.4.0 + +- **Update**: update libraries to build with Xcode 13.1 + ### 0.3.15 --**Update**: update LeadKit dependency +- **Update**: update LeadKit dependency ### 0.3.14 - **Update**: remove Carthage binary dependencies, update build scripts. diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index e46a89e..33d206c 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKitAdditions" - s.version = "0.3.15" + s.version = "0.4.0" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKitAdditions" s.license = "Apache License, Version 2.0" @@ -12,9 +12,9 @@ Pod::Spec.new do |s| ss.ios.deployment_target = '10.0' ss.source_files = "Sources/**/*.swift" - ss.dependency "LeadKit", '~> 0.10.0' - ss.dependency "KeychainAccess", '3.1.0' - ss.dependency "CryptoSwift", '~> 0.9.0' + ss.dependency "LeadKit", '~> 1.7.0' + ss.dependency "KeychainAccess", '~> 4.2.0' + ss.dependency "CryptoSwift", '~> 1.4.0' ss.dependency "SwiftValidator", '4.0.2' end diff --git a/LeadKitAdditions.xcodeproj/project.pbxproj b/LeadKitAdditions.xcodeproj/project.pbxproj index 186993c..04897ec 100644 --- a/LeadKitAdditions.xcodeproj/project.pbxproj +++ b/LeadKitAdditions.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 14E3AD49502B3D81264560DB /* Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EDEF7F6C22BB04CBB754C14 /* Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework */; }; 67779CBC206986390098F024 /* BaseTextFieldViewEvents+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67779CBB206986390098F024 /* BaseTextFieldViewEvents+Extensions.swift */; }; 678D26AA206935B900B05B93 /* BiometricsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678D26A9206935B900B05B93 /* BiometricsService.swift */; }; 67B4E6F6206945DD00E233EA /* OnlineValidationResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67B4E6F5206945DC00E233EA /* OnlineValidationResult.swift */; }; @@ -19,7 +20,6 @@ 786CBB32220DD7A70017587F /* LeadKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB25220DD7A70017587F /* LeadKit.framework */; }; 786CBB33220DD7A70017587F /* SwiftValidator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB26220DD7A70017587F /* SwiftValidator.framework */; }; 786CBB34220DD7A70017587F /* UIScrollView_InfiniteScroll.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB27220DD7A70017587F /* UIScrollView_InfiniteScroll.framework */; }; - 786CBB35220DD7A70017587F /* RxAtomic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB28220DD7A70017587F /* RxAtomic.framework */; }; 786CBB36220DD7A70017587F /* RxAlamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB29220DD7A70017587F /* RxAlamofire.framework */; }; 786CBB37220DD7A70017587F /* SwiftDate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB2A220DD7A70017587F /* SwiftDate.framework */; }; 786CBB38220DD7A70017587F /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786CBB2B220DD7A70017587F /* RxCocoa.framework */; }; @@ -46,6 +46,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 1AC235099AA10D83D608A253 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LeadKitAdditions-LeadKitAdditions iOS.release.xcconfig"; path = "Target Support Files/Pods-LeadKitAdditions-LeadKitAdditions iOS/Pods-LeadKitAdditions-LeadKitAdditions iOS.release.xcconfig"; sourceTree = ""; }; + 3EDEF7F6C22BB04CBB754C14 /* Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 67528BCE206E3CC6009F2525 /* iOS.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = iOS.playground; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 67779CBB206986390098F024 /* BaseTextFieldViewEvents+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BaseTextFieldViewEvents+Extensions.swift"; sourceTree = ""; }; 678D26A9206935B900B05B93 /* BiometricsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricsService.swift; sourceTree = ""; }; @@ -53,13 +55,13 @@ 67B4E6F5206945DC00E233EA /* OnlineValidationResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnlineValidationResult.swift; sourceTree = ""; }; 67B4E6F8206945F900E233EA /* OnlineValidationState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnlineValidationState.swift; sourceTree = ""; }; 67D6041721627600002DAF5B /* LegacyConfigurableController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyConfigurableController.swift; sourceTree = ""; }; + 6FEE03727D0B955F00DE8429 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LeadKitAdditions-LeadKitAdditions iOS.debug.xcconfig"; path = "Target Support Files/Pods-LeadKitAdditions-LeadKitAdditions iOS/Pods-LeadKitAdditions-LeadKitAdditions iOS.debug.xcconfig"; sourceTree = ""; }; 786CBB22220DD7A70017587F /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; }; 786CBB23220DD7A70017587F /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; 786CBB24220DD7A70017587F /* TableKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TableKit.framework; path = Carthage/Build/iOS/TableKit.framework; sourceTree = ""; }; 786CBB25220DD7A70017587F /* LeadKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LeadKit.framework; path = Carthage/Build/iOS/LeadKit.framework; sourceTree = ""; }; 786CBB26220DD7A70017587F /* SwiftValidator.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftValidator.framework; path = Carthage/Build/iOS/SwiftValidator.framework; sourceTree = ""; }; 786CBB27220DD7A70017587F /* UIScrollView_InfiniteScroll.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIScrollView_InfiniteScroll.framework; path = Carthage/Build/iOS/UIScrollView_InfiniteScroll.framework; sourceTree = ""; }; - 786CBB28220DD7A70017587F /* RxAtomic.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxAtomic.framework; path = Carthage/Build/iOS/RxAtomic.framework; sourceTree = ""; }; 786CBB29220DD7A70017587F /* RxAlamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxAlamofire.framework; path = Carthage/Build/iOS/RxAlamofire.framework; sourceTree = ""; }; 786CBB2A220DD7A70017587F /* SwiftDate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftDate.framework; path = Carthage/Build/iOS/SwiftDate.framework; sourceTree = ""; }; 786CBB2B220DD7A70017587F /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; }; @@ -100,12 +102,12 @@ 786CBB32220DD7A70017587F /* LeadKit.framework in Frameworks */, 786CBB33220DD7A70017587F /* SwiftValidator.framework in Frameworks */, 786CBB34220DD7A70017587F /* UIScrollView_InfiniteScroll.framework in Frameworks */, - 786CBB35220DD7A70017587F /* RxAtomic.framework in Frameworks */, 786CBB36220DD7A70017587F /* RxAlamofire.framework in Frameworks */, 786CBB37220DD7A70017587F /* SwiftDate.framework in Frameworks */, 786CBB38220DD7A70017587F /* RxCocoa.framework in Frameworks */, 786CBB39220DD7A70017587F /* CryptoSwift.framework in Frameworks */, 786CBB3A220DD7A70017587F /* KeychainAccess.framework in Frameworks */, + 14E3AD49502B3D81264560DB /* Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,13 +139,13 @@ 786CBB25220DD7A70017587F /* LeadKit.framework */, 786CBB2E220DD7A70017587F /* PinLayout.framework */, 786CBB29220DD7A70017587F /* RxAlamofire.framework */, - 786CBB28220DD7A70017587F /* RxAtomic.framework */, 786CBB2B220DD7A70017587F /* RxCocoa.framework */, 786CBB22220DD7A70017587F /* RxSwift.framework */, 786CBB2A220DD7A70017587F /* SwiftDate.framework */, 786CBB26220DD7A70017587F /* SwiftValidator.framework */, 786CBB24220DD7A70017587F /* TableKit.framework */, 786CBB27220DD7A70017587F /* UIScrollView_InfiniteScroll.framework */, + 3EDEF7F6C22BB04CBB754C14 /* Pods_LeadKitAdditions_LeadKitAdditions_iOS.framework */, ); name = Frameworks; sourceTree = ""; @@ -155,6 +157,7 @@ CAE698E41E968820000394B0 /* Products */, CAE698E51E968820000394B0 /* Sources */, 67528BCE206E3CC6009F2525 /* iOS.playground */, + FBC34E01DAB566B85ED77BAD /* Pods */, ); sourceTree = ""; }; @@ -279,6 +282,15 @@ path = ValidationService; sourceTree = ""; }; + FBC34E01DAB566B85ED77BAD /* Pods */ = { + isa = PBXGroup; + children = ( + 6FEE03727D0B955F00DE8429 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.debug.xcconfig */, + 1AC235099AA10D83D608A253 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -297,6 +309,7 @@ isa = PBXNativeTarget; buildConfigurationList = CAE698EB1E968820000394B0 /* Build configuration list for PBXNativeTarget "LeadKitAdditions iOS" */; buildPhases = ( + DA96E76177E2633117FCBE55 /* [CP] Check Pods Manifest.lock */, CAE698DE1E968820000394B0 /* Sources */, CAE698DF1E968820000394B0 /* Frameworks */, CAE698E01E968820000394B0 /* Headers */, @@ -371,6 +384,28 @@ shellPath = /bin/sh; shellScript = ". run_swiftlint.sh\n"; }; + DA96E76177E2633117FCBE55 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-LeadKitAdditions-LeadKitAdditions iOS-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -528,6 +563,7 @@ }; CAE698EC1E968820000394B0 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6FEE03727D0B955F00DE8429 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.debug.xcconfig */; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; @@ -537,13 +573,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "touchinstinct.LeadKitAdditions-iOS"; PRODUCT_NAME = LeadKitAdditions; @@ -556,6 +588,7 @@ }; CAE698ED1E968820000394B0 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 1AC235099AA10D83D608A253 /* Pods-LeadKitAdditions-LeadKitAdditions iOS.release.xcconfig */; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; @@ -565,13 +598,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "touchinstinct.LeadKitAdditions-iOS"; PRODUCT_NAME = LeadKitAdditions; diff --git a/Podfile b/Podfile index f597e20..97ba2ec 100644 --- a/Podfile +++ b/Podfile @@ -1,20 +1,20 @@ -source "https://github.com/CocoaPods/Specs.git" +source 'https://cdn.cocoapods.org/' source "https://github.com/TouchInstinct/Podspecs.git" abstract_target 'LeadKitAdditions' do - pod "KeychainAccess", '3.1.0' - pod "CryptoSwift", "~> 0.9.0" + pod "KeychainAccess", '~> 4.2.0' + pod "CryptoSwift", "~> 1.4.0" pod "SwiftValidator", '4.0.2' - pod "SwiftLint", '~> 0.25' + pod "SwiftLint", '~> 0.45.0' pod "PinLayout", '~> 1.6' inhibit_all_warnings! use_frameworks! target 'LeadKitAdditions iOS' do - platform :ios, '9.0' + platform :ios, '10.0' - pod 'LeadKit', '~> 0.9.0' + pod 'LeadKit', '~> 1.7.0' end end diff --git a/Podfile.lock b/Podfile.lock index f7235b1..ba95eb4 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,78 +1,81 @@ PODS: - - Alamofire (4.7.3) - - CryptoSwift (0.9.0) - - KeychainAccess (3.1.0) - - LeadKit (0.9.0): - - LeadKit/Core (= 0.9.0) - - LeadKit/Core (0.9.0): - - RxAlamofire (~> 4.3) - - RxCocoa (~> 4.3) - - RxSwift (~> 4.3) - - SwiftDate (~> 5.0) - - TableKit (~> 2.8) + - Alamofire (5.5.0) + - CryptoSwift (1.4.2) + - KeychainAccess (4.2.2) + - LeadKit (1.7.0): + - LeadKit/Core (= 1.7.0) + - LeadKit/Core (1.7.0): + - RxAlamofire (~> 6.1) + - RxCocoa (~> 6.2) + - RxSwift (~> 6.2) + - SnapKit (~> 5.0.1) + - SwiftDate (~> 6) + - TableKit (~> 2.11) - UIScrollView-InfiniteScroll (~> 1.1.0) - - LeadKit/Core-iOS-Extension (0.9.0): - - RxAlamofire (~> 4.3) - - RxCocoa (~> 4.3) - - RxSwift (~> 4.3) - - SwiftDate (~> 5.0) - - TableKit (~> 2.8) - PinLayout (1.8.6) - - RxAlamofire (4.3.0): - - RxAlamofire/Core (= 4.3.0) - - RxAlamofire/Core (4.3.0): - - Alamofire (~> 4.5) - - RxSwift (~> 4) - - RxCocoa (4.3.1): - - RxSwift (~> 4.0) - - RxSwift (4.3.1) - - SwiftDate (5.0.10) - - SwiftLint (0.27.0) + - RxAlamofire (6.1.1): + - RxAlamofire/Core (= 6.1.1) + - RxAlamofire/Core (6.1.1): + - Alamofire (~> 5.4) + - RxSwift (~> 6.0) + - RxCocoa (6.2.0): + - RxRelay (= 6.2.0) + - RxSwift (= 6.2.0) + - RxRelay (6.2.0): + - RxSwift (= 6.2.0) + - RxSwift (6.2.0) + - SnapKit (5.0.1) + - SwiftDate (6.3.1) + - SwiftLint (0.45.1) - SwiftValidator (4.0.2) - - TableKit (2.8.0) + - TableKit (2.11.0) - UIScrollView-InfiniteScroll (1.1.0) DEPENDENCIES: - - CryptoSwift (~> 0.9.0) - - KeychainAccess (= 3.1.0) - - LeadKit (~> 0.9.0) - - LeadKit/Core-iOS-Extension (~> 0.9.0) + - CryptoSwift (~> 1.4.0) + - KeychainAccess (~> 4.2.0) + - LeadKit (~> 1.7.0) - PinLayout (~> 1.6) - - SwiftLint (~> 0.25) + - SwiftLint (~> 0.45.0) - SwiftValidator (= 4.0.2) SPEC REPOS: - https://github.com/cocoapods/specs.git: + https://github.com/CocoaPods/Specs.git: + - PinLayout + https://github.com/TouchInstinct/Podspecs.git: + - LeadKit + - SwiftValidator + trunk: - Alamofire - CryptoSwift - KeychainAccess - - PinLayout - RxAlamofire - RxCocoa + - RxRelay - RxSwift + - SnapKit - SwiftDate - SwiftLint - TableKit - UIScrollView-InfiniteScroll - https://github.com/TouchInstinct/Podspecs.git: - - LeadKit - - SwiftValidator SPEC CHECKSUMS: - Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568 - CryptoSwift: bca8c5b653dcc2d9734409242a070ff53bafac86 - KeychainAccess: 94c5540b32eabf7bc32bfb976a268e8ea05fd6da - LeadKit: 80787b6215648cf9bfedf2c591fbe924ba4940a1 + Alamofire: 1c4fb5369c3fe93d2857c780d8bbe09f06f97e7c + CryptoSwift: a532e74ed010f8c95f611d00b8bbae42e9fe7c17 + KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51 + LeadKit: e5765a6edac2813042304e940fd7a43b37be80ca PinLayout: fe2a2432d6982588e208572005c941aeeae417ab - RxAlamofire: 09624d0f2d48ed8b686e4eb4cf68e28cbd2df556 - RxCocoa: 78763c7b07d02455598d9fc3c1ad091a28b73635 - RxSwift: fe0fd770a43acdb7d0a53da411c9b892e69bb6e4 - SwiftDate: fcdaa7ca22a903faf6d7ed231239a88d174dcae3 - SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073 + RxAlamofire: beb75a1c452d0de225651db4903f5d29d034a620 + RxCocoa: 4baf94bb35f2c0ab31bc0cb9f1900155f646ba42 + RxRelay: e72dbfd157807478401ef1982e1c61c945c94b2f + RxSwift: d356ab7bee873611322f134c5f9ef379fa183d8f + SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb + SwiftDate: 72d28954e8e1c6c1c0f917ccc8005e4f83c7d4b2 + SwiftLint: 06ac37e4d38c7068e0935bb30cda95f093bec761 SwiftValidator: 8517a67bceebd7286cb487da259db7dd44c5fc74 - TableKit: d635663343d00e209f258e35d4ee0072ad1beb1a + TableKit: 8a1a267d841a2da638ea09bdb0db33aedb459fa8 UIScrollView-InfiniteScroll: 3ef456bcbe759c19f510a383cff96e6647c98c98 -PODFILE CHECKSUM: 447350715f27bad97492296a2ed066c844cfaf5a +PODFILE CHECKSUM: 1d0f91b670998d56b8cf9bc24d5b265a89e8409b -COCOAPODS: 1.6.0.beta.2 +COCOAPODS: 1.10.1 diff --git a/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift b/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift index 0ba7088..ff22db8 100644 --- a/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift +++ b/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift @@ -99,7 +99,7 @@ public extension BaseTextFieldViewModelEvents { using offlineRules: [Rule] = [], validationClosure: @escaping OnlineValidationClosure) -> Driver { - return textDriver.flatMap { string -> Driver in + textDriver.flatMap { string -> Driver in guard let nonEmptyString = string, !nonEmptyString.isEmpty else { return .just(.initial) } diff --git a/Sources/Classes/LoadingBarButton.swift b/Sources/Classes/LoadingBarButton.swift index 780140f..be8f684 100644 --- a/Sources/Classes/LoadingBarButton.swift +++ b/Sources/Classes/LoadingBarButton.swift @@ -93,8 +93,8 @@ public extension Observable { - Returns: - observable, that handles LoadingBarButton behaviour */ - func changeLoadingUI(using barButton: LoadingBarButton) -> Observable { - return observeOn(MainScheduler.instance) + func changeLoadingUI(using barButton: LoadingBarButton) -> Observable { + observe(on: MainScheduler.instance) .do(onSubscribe: { barButton.setState(waiting: true) }, onDispose: { diff --git a/Sources/Controllers/PassCode/Model/PassCodeConfiguration.swift b/Sources/Controllers/PassCode/Model/PassCodeConfiguration.swift index 4d9bc18..3faaf47 100644 --- a/Sources/Controllers/PassCode/Model/PassCodeConfiguration.swift +++ b/Sources/Controllers/PassCode/Model/PassCodeConfiguration.swift @@ -40,6 +40,6 @@ public struct PassCodeConfiguration { /// Returns configuration with default values public static var defaultConfiguration: PassCodeConfiguration { - return PassCodeConfiguration() + PassCodeConfiguration() } } diff --git a/Sources/Controllers/PassCode/Model/PassCodeHolder.swift b/Sources/Controllers/PassCode/Model/PassCodeHolder.swift index 21d9201..30b90d1 100644 --- a/Sources/Controllers/PassCode/Model/PassCodeHolder.swift +++ b/Sources/Controllers/PassCode/Model/PassCodeHolder.swift @@ -26,15 +26,15 @@ import RxCocoa public extension PassCodeHolderProtocol { var passCodeHolderCreate: PassCodeHolderCreate? { - return self as? PassCodeHolderCreate + self as? PassCodeHolderCreate } var passCodeHolderEnter: PassCodeHolderEnter? { - return self as? PassCodeHolderEnter + self as? PassCodeHolderEnter } var passCodeHolderChange: PassCodeHolderChange? { - return self as? PassCodeHolderChange + self as? PassCodeHolderChange } } @@ -55,7 +55,7 @@ public class PassCodeHolderCreate: PassCodeHolderProtocol { } public var shouldValidate: Bool { - return firstPassCode != nil && secondPassCode != nil + firstPassCode != nil && secondPassCode != nil } public var passCode: String? { @@ -100,7 +100,7 @@ public class PassCodeHolderEnter: PassCodeHolderProtocol { public let enterStep: PassCodeControllerState = .enter public var shouldValidate: Bool { - return passCode != nil + passCode != nil } public var passCode: String? @@ -153,7 +153,7 @@ public class PassCodeHolderChange: PassCodeHolderProtocol { public var passCode: String? { switch (oldPassCode, newFirstPassCode, newSecondPassCode) { - case (let oldPassCode?, nil, nil): + case let (oldPassCode?, nil, nil): return oldPassCode case (_, _?, nil): diff --git a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift index e4aa96b..795bd24 100644 --- a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift +++ b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift @@ -201,7 +201,8 @@ open class BasePassCodeViewController: UIViewController, LegacyConfigurableContr .sorted { $0.delay < $1.delay } .map { [weak self] delayedDescription in Observable - .interval(delayedDescription.delay, scheduler: MainScheduler.instance) + .interval(.seconds(Int(delayedDescription.delay)), + scheduler: MainScheduler.instance) .take(1) .do(onNext: { _ in self?.errorLabel?.attributedText = delayedDescription.description @@ -260,7 +261,7 @@ open class BasePassCodeViewController: UIViewController, LegacyConfigurableContr self?.setStates(for: text ?? "") self?.hideError() }) - .delay(0.1) // time to draw dots + .delay(.milliseconds(100)) // time to draw dots .drive(onNext: { [weak self] text in self?.viewModel.setPassCodeText(text) }) diff --git a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift index 9be668a..12ca5e4 100644 --- a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift +++ b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift @@ -20,7 +20,6 @@ // THE SOFTWARE. // -import LeadKit import RxSwift import RxCocoa @@ -31,7 +30,7 @@ public enum PassCodeAuthType { } /// Base view model for passCodeViewController -open class BasePassCodeViewModel: BaseViewModel { +open class BasePassCodeViewModel { public let operationType: PassCodeOperationType @@ -43,17 +42,17 @@ open class BasePassCodeViewModel: BaseViewModel { /// Contains configuration for pass code operations public let passCodeConfiguration: PassCodeConfiguration - private let validationResultHolder = Variable(nil) + private let validationResultHolder = BehaviorRelay(value: nil) public var validationResultDriver: Driver { - return validationResultHolder.asDriver() + validationResultHolder.asDriver() } - private let passCodeControllerStateVariable = Variable(.enter) + private let passCodeControllerStateVariable = BehaviorRelay(value: .enter) public var passCodeControllerStateDriver: Driver { - return passCodeControllerStateVariable.asDriver() + passCodeControllerStateVariable.asDriver() } - private let passCodeText = Variable(nil) + private let passCodeText = BehaviorRelay(value: nil) private var attemptsNumber = 0 @@ -85,17 +84,17 @@ open class BasePassCodeViewModel: BaseViewModel { // MARK: - Public public var passCodeTextValue: String? { - return passCodeText.value + passCodeText.value } public func setPassCodeText(_ value: String?) { - passCodeText.value = value + passCodeText.accept(value) } public func reset() { - passCodeText.value = nil - validationResultHolder.value = nil - passCodeControllerStateVariable.value = operationType == .change ? .oldEnter : .enter + passCodeText.accept(nil) + validationResultHolder.accept(nil) + passCodeControllerStateVariable.accept(operationType == .change ? .oldEnter : .enter) attemptsNumber = 0 passCodeHolder.reset() } @@ -136,7 +135,7 @@ open class BasePassCodeViewModel: BaseViewModel { /// Posibility to use biometrics for authentication open var isBiometricsEnabled: Bool { - return false + false } /// Notify about activation for biometrics. Remember to save user choice @@ -153,7 +152,7 @@ open class BasePassCodeViewModel: BaseViewModel { private extension BasePassCodeViewModel { var validationResultBinder: Binder { - return Binder(self) { model, validationResult in + Binder(self) { model, validationResult in let isValid = validationResult?.isValid ?? false let passCode = validationResult?.passCode @@ -161,13 +160,13 @@ private extension BasePassCodeViewModel { if isValid, model.passCodeHolder.enterStep == .repeatEnter, let passCode = passCode { model.authSucceed(.passCode(passCode)) } else { - model.passCodeControllerStateVariable.value = model.passCodeHolder.enterStep + model.passCodeControllerStateVariable.accept(model.passCodeHolder.enterStep) } } else { if isValid, let passCode = passCode { model.authSucceed(.passCode(passCode)) } else { - model.passCodeControllerStateVariable.value = model.passCodeHolder.enterStep + model.passCodeControllerStateVariable.accept(model.passCodeHolder.enterStep) } } } @@ -181,12 +180,12 @@ extension BasePassCodeViewModel { validateIfNeeded() if shouldUpdateControllerState { - passCodeControllerStateVariable.value = passCodeHolder.enterStep + passCodeControllerStateVariable.accept(passCodeHolder.enterStep) } } private var shouldUpdateControllerState: Bool { - return !passCodeHolder.shouldValidate || + !passCodeHolder.shouldValidate || !(validationResultHolder.value?.isValid ?? true) || validationResultHolder.value?.error?.isTooManyAttempts ?? false } @@ -231,6 +230,6 @@ extension BasePassCodeViewModel { passCodeHolder.reset() } - validationResultHolder.value = validationResult + validationResultHolder.accept(validationResult) } } diff --git a/Sources/Extensions/Error+NetworkingExtensions.swift b/Sources/Extensions/Error+NetworkingExtensions.swift index 95512cf..bab0b3d 100644 --- a/Sources/Extensions/Error+NetworkingExtensions.swift +++ b/Sources/Extensions/Error+NetworkingExtensions.swift @@ -15,6 +15,6 @@ public extension Error { /// Returns: true if server json response is not valid var isResponseSerializationError: Bool { - return (self as? AFError)?.isResponseSerializationError ?? false + (self as? AFError)?.isResponseSerializationError ?? false } } diff --git a/Sources/Extensions/UserDefaults+UserService.swift b/Sources/Extensions/UserDefaults+UserService.swift index 86f2afd..484efea 100644 --- a/Sources/Extensions/UserDefaults+UserService.swift +++ b/Sources/Extensions/UserDefaults+UserService.swift @@ -32,7 +32,7 @@ public extension UserDefaults { /// Default place to store session id var sessionId: String? { get { - return string(forKey: Keys.sessionId) + string(forKey: Keys.sessionId) } set { set(newValue, forKey: Keys.sessionId) @@ -42,7 +42,7 @@ public extension UserDefaults { /// Default place to store userLogin var userLogin: String? { get { - return string(forKey: Keys.userLogin) + string(forKey: Keys.userLogin) } set { set(newValue, forKey: Keys.userLogin) diff --git a/Sources/Services/BasePassCodeService.swift b/Sources/Services/BasePassCodeService.swift index b0b5aba..7b7aad6 100644 --- a/Sources/Services/BasePassCodeService.swift +++ b/Sources/Services/BasePassCodeService.swift @@ -39,7 +39,7 @@ open class BasePassCodeService { /// Override to set specific keychain service name open class var keychainServiceString: String { - return Bundle.main.bundleIdentifier ?? "" + Bundle.main.bundleIdentifier ?? "" } public init() { @@ -55,7 +55,7 @@ open class BasePassCodeService { private lazy var keychain = Keychain(service: BasePassCodeService.keychainServiceString).synchronizable(false) private var passCodeHash: String? { - return keychain[Keys.passCodeHash] + keychain[Keys.passCodeHash] } } @@ -63,13 +63,13 @@ public extension BasePassCodeService { /// Indicates is pass code already saved on this device var isPassCodeSaved: Bool { - return keychain[Keys.passCodeHash] != nil + keychain[Keys.passCodeHash] != nil } /// Possibility to authenticate via biometrics. TouchID or FaceID var isBiometricsAuthorizationEnabled: Bool { get { - return keychain[Keys.isBiometricsEnabled] == Values.biometricsEnabled + keychain[Keys.isBiometricsEnabled] == Values.biometricsEnabled } set { keychain[Keys.isBiometricsEnabled] = newValue ? Values.biometricsEnabled : nil @@ -87,7 +87,7 @@ public extension BasePassCodeService { /// Check if pass code is correct func check(passCode: String) -> Bool { - return passCode.sha256() == passCodeHash + passCode.sha256() == passCodeHash } /// Reset pass code settings diff --git a/Sources/Services/BaseUserService.swift b/Sources/Services/BaseUserService.swift index 5cb3fdb..d33d884 100644 --- a/Sources/Services/BaseUserService.swift +++ b/Sources/Services/BaseUserService.swift @@ -21,7 +21,6 @@ // import RxSwift -import LeadKit /// Represents service that store basic user information open class BaseUserService { @@ -51,7 +50,7 @@ open class BaseUserService { /// Indicates if user is logged in open var isLoggedIn: Bool { - return UserDefaults.standard.sessionId != nil + UserDefaults.standard.sessionId != nil } /// Reset user information diff --git a/Sources/Services/BiometricsService.swift b/Sources/Services/BiometricsService.swift index 7bec607..7311382 100644 --- a/Sources/Services/BiometricsService.swift +++ b/Sources/Services/BiometricsService.swift @@ -41,7 +41,7 @@ public final class BiometricsService { /// If the user unlocks the device using biometrics within the specified time interval, /// then authentication for the receiver succeeds automatically, without prompting the user for biometrics. /// Works only after device unlock event, no other apps authentications counts. - public var allowableReuseDuration: TimeInterval? = nil { + public var allowableReuseDuration: TimeInterval? { didSet { guard let duration = allowableReuseDuration else { return @@ -85,7 +85,7 @@ public final class BiometricsService { /// Indicates is it possible to authenticate on this device via any biometric. /// Returns false if not enrolled or lockedout. public var canAuthenticateWithBiometrics: Bool { - return laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) + laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) } /** diff --git a/Sources/Services/ValidationService/ValidationItem.swift b/Sources/Services/ValidationService/ValidationItem.swift index 54e160d..745c54d 100644 --- a/Sources/Services/ValidationService/ValidationItem.swift +++ b/Sources/Services/ValidationService/ValidationItem.swift @@ -36,15 +36,15 @@ public final class ValidationItem { private let disposeBag = DisposeBag() - private let validationStateHolder = Variable(.initial) + private let validationStateHolder = BehaviorRelay(value: .initial) public var validationState: ValidationItemState { - return validationStateHolder.value + validationStateHolder.value } public var validationStateObservable: Observable { - return validationStateHolder.asObservable() + validationStateHolder.asObservable() } - private let text = Variable(nil) + private let text = BehaviorRelay(value: nil) private(set) var rules: [Rule] = [] @@ -90,13 +90,13 @@ public final class ValidationItem { .correction where !isManual, .valid where !isManual: - validationStateHolder.value = .correction(validationError) + validationStateHolder.accept(.correction(validationError)) default: - validationStateHolder.value = .error(validationError) + validationStateHolder.accept(.error(validationError)) } } else { - validationStateHolder.value = .valid + validationStateHolder.accept(.valid) } } } diff --git a/Sources/Services/ValidationService/ValidationService.swift b/Sources/Services/ValidationService/ValidationService.swift index 5662744..8f1e31d 100644 --- a/Sources/Services/ValidationService/ValidationService.swift +++ b/Sources/Services/ValidationService/ValidationService.swift @@ -17,7 +17,7 @@ public enum ValidationServiceState { public extension ValidationServiceState { var isValid: Bool { - return self == .valid + self == .valid } } @@ -27,12 +27,12 @@ public final class ValidationService { private(set) var validationItems: [ValidationItem] = [] - private let stateHolder = Variable(.initial) + private let stateHolder = BehaviorRelay(value: .initial) public var state: ValidationServiceState { - return stateHolder.value + stateHolder.value } public var stateObservable: Observable { - return stateHolder.asObservable() + stateHolder.asObservable() } private var validationStateReactType: ValidationServiceStateReactType = .none @@ -84,11 +84,15 @@ public final class ValidationService { let zipStates = Observable .zip(allValidationStateObservables) { $0 } - .filter { [weak self] _ in self?.validationStateReactType == .all } + .filter { [weak self] _ in + self?.validationStateReactType == .all + } let combineLatestStates = Observable .combineLatest(allValidationStateObservables) { $0 } - .filter { [weak self] _ in self?.validationStateReactType == .each } + .filter { [weak self] _ in + self?.validationStateReactType == .each + } let stateObservables = [zipStates, combineLatestStates] diff --git a/build-scripts b/build-scripts index 1f83bf5..2799169 160000 --- a/build-scripts +++ b/build-scripts @@ -1 +1 @@ -Subproject commit 1f83bf5d08bbc2c2346141621a42b2d2e0dd6517 +Subproject commit 2799169e2103c034b0e1be221860a23292766f36 diff --git a/run_swiftlint.sh b/run_swiftlint.sh index 01c1db0..95436f6 100644 --- a/run_swiftlint.sh +++ b/run_swiftlint.sh @@ -2,7 +2,7 @@ readonly CONFIG_PATH=${PROJECT_DIR}/build-scripts/xcode/.swiftlint.yml -readonly SWIFTLINT_VERSION=0.31.0 +readonly SWIFTLINT_VERSION=0.45.1 readonly SWIFTLINT_PORTABLE_FILENAME=portable_swiftlint.zip readonly SWIFTLINT_PORTABLE_URL=https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/${SWIFTLINT_PORTABLE_FILENAME}