From f1553fb594aed08ba71f4db297eebd72c5632eaa Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 25 Sep 2017 10:49:20 +0300 Subject: [PATCH 1/5] Update IDZSwiftCommonCrypto & bump LeadKit --- LeadKitAdditions/Podfile | 2 +- LeadKitAdditions/Podfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/LeadKitAdditions/Podfile b/LeadKitAdditions/Podfile index cc95b07..880980c 100644 --- a/LeadKitAdditions/Podfile +++ b/LeadKitAdditions/Podfile @@ -3,7 +3,7 @@ source "https://github.com/TouchInstinct/Podspecs.git" abstract_target 'LeadKitAdditions' do pod 'KeychainAccess', '3.0.2' - pod 'IDZSwiftCommonCrypto', '0.9.1' + pod 'IDZSwiftCommonCrypto' pod 'SwiftValidator', '4.0.0' pod 'InputMask', '2.2.5' diff --git a/LeadKitAdditions/Podfile.lock b/LeadKitAdditions/Podfile.lock index d1004ab..67562d3 100644 --- a/LeadKitAdditions/Podfile.lock +++ b/LeadKitAdditions/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.1) - CocoaLumberjack/Default (3.1.0) - CocoaLumberjack/Swift (3.1.0): - CocoaLumberjack/Default - - IDZSwiftCommonCrypto (0.9.1) + - IDZSwiftCommonCrypto (0.9.3) - InputMask (2.2.5) - KeychainAccess (3.0.2) - LeadKit (0.5.1): @@ -22,7 +22,7 @@ PODS: - RxAlamofire (= 3.0.2) - RxCocoa (= 3.4.0) - RxSwift (= 3.4.0) - - ObjectMapper (2.2.6) + - ObjectMapper (2.2.9) - RxAlamofire (3.0.2): - RxAlamofire/Core (= 3.0.2) - RxAlamofire/Core (3.0.2): @@ -33,10 +33,10 @@ PODS: - RxSwift (3.4.0) - SwiftValidator (4.0.0) - TableKit (2.3.1) - - UIScrollView-InfiniteScroll (1.0.1) + - UIScrollView-InfiniteScroll (1.0.2) DEPENDENCIES: - - IDZSwiftCommonCrypto (= 0.9.1) + - IDZSwiftCommonCrypto - InputMask (= 2.2.5) - KeychainAccess (= 3.0.2) - LeadKit (= 0.5.1) @@ -44,20 +44,20 @@ DEPENDENCIES: - SwiftValidator (= 4.0.0) SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a CocoaLumberjack: 8311463ddf9ee86a06ef92a071dd656c89244500 - IDZSwiftCommonCrypto: c44fe5c0219a219846b56b4c148615dd06e58591 + IDZSwiftCommonCrypto: 03ea02798d8cf2c2a08aa31b1b991e779fb163ed InputMask: fe1da1c6bf39133d88c1f79c507bcb0bf7728d51 KeychainAccess: a986406022dfc7c634c691ad3bec670cc6a32002 LeadKit: a66ca7c85b3e33deb11b6544fa80f45c9f0044e4 - ObjectMapper: 042708195cc46c20871cbcbec0453826398273fd + ObjectMapper: 63cfe41bc6f8e7c8f44344c49901b8ae7de14c52 RxAlamofire: bc53604b29fd2d220cfaa490c736cc4500819f34 RxCocoa: d14ef6b6029e1ddc6e966508c09289090de68ff9 RxSwift: 3789a1af753002a14edecdb698a2424624296a9c SwiftValidator: 2aa43104ac8baaaeaa297f1dc18371c063543fd9 TableKit: 02e041b443f75fa3e9f1ee6024d4b256305bd904 - UIScrollView-InfiniteScroll: a90df4ba4a7ca1926128ade34a850ddbdf74c564 + UIScrollView-InfiniteScroll: c132d6d5851daff229ab4a1060ccf70a05a051c9 -PODFILE CHECKSUM: 6f750f6723897b213ed701c061a4f70baaeb4d54 +PODFILE CHECKSUM: d1b7bb7e14885d8dcf5b620b2c33e20808742b65 COCOAPODS: 1.3.1 From a35960cce66b68c0831d12d93d677d6393a8a685 Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 25 Sep 2017 10:51:58 +0300 Subject: [PATCH 2/5] Update to 0.1 version & add md files --- CHANGELOG.md | 6 ++++++ LeadKitAdditions.podspec | 2 +- README.md | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md create mode 100644 README.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a52ab4d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## 0.1.0 + +- **Add**: support for Swift 3.2 / 4 + diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index 6f8524e..09ac005 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKitAdditions" - s.version = "0.0.22" + s.version = "0.1.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" diff --git a/README.md b/README.md new file mode 100644 index 0000000..27aaf7e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# LeadKitAdditions From 5de300198212f80c4f3d435ca7ab4af036463b27 Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 25 Sep 2017 11:17:32 +0300 Subject: [PATCH 3/5] Update dependency --- LeadKitAdditions.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index 09ac005..be808e9 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| ss.dependency "LeadKit", '~> 0.5' # till 0.6 ss.dependency "KeychainAccess", '3.0.2' - ss.dependency "IDZSwiftCommonCrypto", '0.9.1' + ss.dependency "IDZSwiftCommonCrypto", '~> 0.9' ss.dependency "InputMask", '2.2.5' ss.dependency "SwiftValidator", '4.0.0' end @@ -33,7 +33,7 @@ Pod::Spec.new do |s| ss.dependency "LeadKit/Core-iOS-Extension", '~> 0.5' ss.dependency "KeychainAccess", '3.0.2' - ss.dependency "IDZSwiftCommonCrypto", '0.9.1' + ss.dependency "IDZSwiftCommonCrypto", '~> 0.9' ss.dependency "InputMask", '2.2.5' ss.dependency "SwiftValidator", '4.0.0' end From 0fc708500225d7ae8bb3784248679cd2c6e913ed Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Fri, 20 Oct 2017 11:24:34 +0300 Subject: [PATCH 4/5] continue update (SwiftValidator and InputMask in progress) --- LeadKitAdditions.podspec | 4 +- .../project.pbxproj | 14 ++- LeadKitAdditions/Podfile | 8 +- LeadKitAdditions/Podfile.lock | 90 +++++++++---------- .../Network/DefaultNetworkService.swift | 1 - 5 files changed, 64 insertions(+), 53 deletions(-) diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index 09ac005..31f42aa 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| "LeadKitAdditions/Sources/Services/Network/DefaultNetworkService+ActivityIndicator+Extension.swift", ] - ss.dependency "LeadKit", '~> 0.5' # till 0.6 + ss.dependency "LeadKit", '0.6.0' ss.dependency "KeychainAccess", '3.0.2' ss.dependency "IDZSwiftCommonCrypto", '0.9.1' ss.dependency "InputMask", '2.2.5' @@ -31,7 +31,7 @@ Pod::Spec.new do |s| "LeadKitAdditions/Sources/Services/Network/DefaultNetworkService+ActivityIndicator.swift", ] - ss.dependency "LeadKit/Core-iOS-Extension", '~> 0.5' + ss.dependency "LeadKit/Core-iOS-Extension", '0.6.0' ss.dependency "KeychainAccess", '3.0.2' ss.dependency "IDZSwiftCommonCrypto", '0.9.1' ss.dependency "InputMask", '2.2.5' diff --git a/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj b/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj index 0b469fa..4dda8e6 100644 --- a/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj +++ b/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj @@ -425,7 +425,7 @@ CAE698DA1E968820000394B0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = TouchInstinct; TargetAttributes = { CAE698E21E968820000394B0 = { @@ -670,7 +670,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -678,7 +680,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -724,7 +730,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -732,7 +740,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/LeadKitAdditions/Podfile b/LeadKitAdditions/Podfile index 880980c..ecec0e1 100644 --- a/LeadKitAdditions/Podfile +++ b/LeadKitAdditions/Podfile @@ -2,10 +2,10 @@ source "https://github.com/CocoaPods/Specs.git" source "https://github.com/TouchInstinct/Podspecs.git" abstract_target 'LeadKitAdditions' do - pod 'KeychainAccess', '3.0.2' + pod 'KeychainAccess', '3.1.0' pod 'IDZSwiftCommonCrypto' pod 'SwiftValidator', '4.0.0' - pod 'InputMask', '2.2.5' + pod 'InputMask', '2.2.6' inhibit_all_warnings! @@ -14,7 +14,7 @@ abstract_target 'LeadKitAdditions' do use_frameworks! - pod "LeadKit", '0.5.1' + pod "LeadKit", '0.6.0' end target 'LeadKitAdditions iOS Extensions' do @@ -22,7 +22,7 @@ abstract_target 'LeadKitAdditions' do use_frameworks! - pod "LeadKit/Core-iOS-Extension", '0.5.1' + pod "LeadKit/Core-iOS-Extension", '0.6.0' end end diff --git a/LeadKitAdditions/Podfile.lock b/LeadKitAdditions/Podfile.lock index 67562d3..8773bf4 100644 --- a/LeadKitAdditions/Podfile.lock +++ b/LeadKitAdditions/Podfile.lock @@ -1,63 +1,63 @@ PODS: - Alamofire (4.5.1) - - CocoaLumberjack/Default (3.1.0) - - CocoaLumberjack/Swift (3.1.0): + - CocoaLumberjack/Default (3.3.0) + - CocoaLumberjack/Swift (3.3.0): - CocoaLumberjack/Default - - IDZSwiftCommonCrypto (0.9.3) - - InputMask (2.2.5) - - KeychainAccess (3.0.2) - - LeadKit (0.5.1): - - LeadKit/Core (= 0.5.1) - - LeadKit/Core (0.5.1): - - CocoaLumberjack/Swift (~> 3.1.0) - - ObjectMapper (~> 2.2) - - RxAlamofire (= 3.0.2) - - RxCocoa (= 3.4.0) - - RxSwift (= 3.4.0) - - TableKit (~> 2.3.1) + - IDZSwiftCommonCrypto (0.10.0) + - InputMask (2.2.6) + - KeychainAccess (3.1.0) + - LeadKit (0.6.0): + - LeadKit/Core (= 0.6.0) + - LeadKit/Core (0.6.0): + - CocoaLumberjack/Swift (~> 3.3.0) + - ObjectMapper (~> 3.0.0) + - RxAlamofire (= 4.0.0) + - RxCocoa (= 4.0.0) + - RxSwift (= 4.0.0) + - TableKit (~> 2.5.0) - UIScrollView-InfiniteScroll (~> 1.0.0) - - LeadKit/Core-iOS-Extension (0.5.1): - - CocoaLumberjack/Swift (~> 3.1.0) - - ObjectMapper (~> 2.2) - - RxAlamofire (= 3.0.2) - - RxCocoa (= 3.4.0) - - RxSwift (= 3.4.0) - - ObjectMapper (2.2.9) - - RxAlamofire (3.0.2): - - RxAlamofire/Core (= 3.0.2) - - RxAlamofire/Core (3.0.2): - - Alamofire (~> 4.0) - - RxSwift (~> 3.0) - - RxCocoa (3.4.0): - - RxSwift (~> 3.4) - - RxSwift (3.4.0) + - LeadKit/Core-iOS-Extension (0.6.0): + - CocoaLumberjack/Swift (~> 3.3.0) + - ObjectMapper (~> 3.0.0) + - RxAlamofire (= 4.0.0) + - RxCocoa (= 4.0.0) + - RxSwift (= 4.0.0) + - ObjectMapper (3.0.0) + - RxAlamofire (4.0.0): + - RxAlamofire/Core (= 4.0.0) + - RxAlamofire/Core (4.0.0): + - Alamofire (~> 4.5) + - RxSwift (~> 4.0) + - RxCocoa (4.0.0): + - RxSwift (~> 4.0) + - RxSwift (4.0.0) - SwiftValidator (4.0.0) - - TableKit (2.3.1) + - TableKit (2.5.0) - UIScrollView-InfiniteScroll (1.0.2) DEPENDENCIES: - IDZSwiftCommonCrypto - - InputMask (= 2.2.5) - - KeychainAccess (= 3.0.2) - - LeadKit (= 0.5.1) - - LeadKit/Core-iOS-Extension (= 0.5.1) + - InputMask (= 2.2.6) + - KeychainAccess (= 3.1.0) + - LeadKit (= 0.6.0) + - LeadKit/Core-iOS-Extension (= 0.6.0) - SwiftValidator (= 4.0.0) SPEC CHECKSUMS: Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a - CocoaLumberjack: 8311463ddf9ee86a06ef92a071dd656c89244500 - IDZSwiftCommonCrypto: 03ea02798d8cf2c2a08aa31b1b991e779fb163ed - InputMask: fe1da1c6bf39133d88c1f79c507bcb0bf7728d51 - KeychainAccess: a986406022dfc7c634c691ad3bec670cc6a32002 - LeadKit: a66ca7c85b3e33deb11b6544fa80f45c9f0044e4 - ObjectMapper: 63cfe41bc6f8e7c8f44344c49901b8ae7de14c52 - RxAlamofire: bc53604b29fd2d220cfaa490c736cc4500819f34 - RxCocoa: d14ef6b6029e1ddc6e966508c09289090de68ff9 - RxSwift: 3789a1af753002a14edecdb698a2424624296a9c + CocoaLumberjack: 3c8c74683302f9012bb168e1c4b7ae3c0b558431 + IDZSwiftCommonCrypto: 4eef2c46e262dfbcbc1fd76365e066336680ad7d + InputMask: 756ffc515121d07a9c81a605fa5c44e5ac5bde13 + KeychainAccess: 94c5540b32eabf7bc32bfb976a268e8ea05fd6da + LeadKit: a8b51716890f6d19e2b4e6e5217883d7834d4185 + ObjectMapper: 92230db59bf8f341a5c3a3cf0b9fbdde3cf0d87f + RxAlamofire: 6ea579ac53bf14cb4bc7049a3866e5a769989b1d + RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e + RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334 SwiftValidator: 2aa43104ac8baaaeaa297f1dc18371c063543fd9 - TableKit: 02e041b443f75fa3e9f1ee6024d4b256305bd904 + TableKit: 42d4dff2944f273cdeec2ef6352064eb6a9a355b UIScrollView-InfiniteScroll: c132d6d5851daff229ab4a1060ccf70a05a051c9 -PODFILE CHECKSUM: d1b7bb7e14885d8dcf5b620b2c33e20808742b65 +PODFILE CHECKSUM: 9c0c1a04355f00f95d5aebadbc3a981fcd55e150 COCOAPODS: 1.3.1 diff --git a/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift b/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift index 7082eb3..2b214b5 100644 --- a/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift +++ b/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift @@ -22,7 +22,6 @@ import Alamofire import LeadKit -import ObjectMapper import RxSwift /// Default implementation of network service, which trust any server and use default timeout interval From b6e5bdd70f73777100ba5426d8b0e38fb9b31368 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Mon, 23 Oct 2017 14:35:45 +0300 Subject: [PATCH 5/5] final Swift 4 migration --- .swift-version | 1 + LeadKitAdditions.podspec | 12 +++++----- .../project.pbxproj | 10 ++++----- LeadKitAdditions/Podfile | 4 ++-- LeadKitAdditions/Podfile.lock | 14 ++++++------ .../View/BasePassCodeViewController.swift | 8 +++---- .../ViewModel/BasePassCodeViewModel.swift | 4 ++-- .../Extensions/Observable+Extensions.swift | 12 +++++----- .../Protocols/CellFieldJumpingProtocol.swift | 4 ++-- .../Services/BasePassCodeService.swift | 2 +- .../Services/CellFieldsJumpingService.swift | 22 +++++++++---------- .../Sources/Services/MaskFieldTextProxy.swift | 2 +- .../Network/DefaultNetworkService.swift | 6 +++-- .../ValidationService/ValidationItem.swift | 2 +- .../ValidationService/ValidationService.swift | 2 +- .../Views/CellTextField/CellTextField.swift | 10 ++++----- .../Sources/Views/CellTextFieldToolBar.swift | 6 ++--- 17 files changed, 62 insertions(+), 59 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..5186d07 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.0 diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index 31f42aa..f3a6ccf 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -17,10 +17,10 @@ Pod::Spec.new do |s| ] ss.dependency "LeadKit", '0.6.0' - ss.dependency "KeychainAccess", '3.0.2' + ss.dependency "KeychainAccess", '3.1.0' ss.dependency "IDZSwiftCommonCrypto", '0.9.1' - ss.dependency "InputMask", '2.2.5' - ss.dependency "SwiftValidator", '4.0.0' + ss.dependency "InputMask", '3.0.0' + ss.dependency "SwiftValidator", '5.0.0' end s.subspec 'Core-iOS-Extension' do |ss| @@ -32,10 +32,10 @@ Pod::Spec.new do |s| ] ss.dependency "LeadKit/Core-iOS-Extension", '0.6.0' - ss.dependency "KeychainAccess", '3.0.2' + ss.dependency "KeychainAccess", '3.1.0' ss.dependency "IDZSwiftCommonCrypto", '0.9.1' - ss.dependency "InputMask", '2.2.5' - ss.dependency "SwiftValidator", '4.0.0' + ss.dependency "InputMask", '3.0.0' + ss.dependency "SwiftValidator", '5.0.0' end s.default_subspec = 'Core' diff --git a/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj b/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj index 4dda8e6..e6fa317 100644 --- a/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj +++ b/LeadKitAdditions/LeadKitAdditions.xcodeproj/project.pbxproj @@ -430,7 +430,7 @@ TargetAttributes = { CAE698E21E968820000394B0 = { CreatedOnToolsVersion = 8.3; - LastSwiftMigration = 0830; + LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; EFBD556F1EBB87100062AA63 = { @@ -794,7 +794,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -818,7 +818,7 @@ PRODUCT_NAME = LeadKitAdditions; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -842,7 +842,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -866,7 +866,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/LeadKitAdditions/Podfile b/LeadKitAdditions/Podfile index ecec0e1..d16fd63 100644 --- a/LeadKitAdditions/Podfile +++ b/LeadKitAdditions/Podfile @@ -4,8 +4,8 @@ source "https://github.com/TouchInstinct/Podspecs.git" abstract_target 'LeadKitAdditions' do pod 'KeychainAccess', '3.1.0' pod 'IDZSwiftCommonCrypto' - pod 'SwiftValidator', '4.0.0' - pod 'InputMask', '2.2.6' + pod "InputMask", '3.0.0' + pod "SwiftValidator", '5.0.0' inhibit_all_warnings! diff --git a/LeadKitAdditions/Podfile.lock b/LeadKitAdditions/Podfile.lock index 8773bf4..a6d89a7 100644 --- a/LeadKitAdditions/Podfile.lock +++ b/LeadKitAdditions/Podfile.lock @@ -4,7 +4,7 @@ PODS: - CocoaLumberjack/Swift (3.3.0): - CocoaLumberjack/Default - IDZSwiftCommonCrypto (0.10.0) - - InputMask (2.2.6) + - InputMask (3.0.0) - KeychainAccess (3.1.0) - LeadKit (0.6.0): - LeadKit/Core (= 0.6.0) @@ -31,33 +31,33 @@ PODS: - RxCocoa (4.0.0): - RxSwift (~> 4.0) - RxSwift (4.0.0) - - SwiftValidator (4.0.0) + - SwiftValidator (5.0.0) - TableKit (2.5.0) - UIScrollView-InfiniteScroll (1.0.2) DEPENDENCIES: - IDZSwiftCommonCrypto - - InputMask (= 2.2.6) + - InputMask (= 3.0.0) - KeychainAccess (= 3.1.0) - LeadKit (= 0.6.0) - LeadKit/Core-iOS-Extension (= 0.6.0) - - SwiftValidator (= 4.0.0) + - SwiftValidator (= 5.0.0) SPEC CHECKSUMS: Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a CocoaLumberjack: 3c8c74683302f9012bb168e1c4b7ae3c0b558431 IDZSwiftCommonCrypto: 4eef2c46e262dfbcbc1fd76365e066336680ad7d - InputMask: 756ffc515121d07a9c81a605fa5c44e5ac5bde13 + InputMask: 37c273bde6705187d80cf0b4240cb42ea92096c3 KeychainAccess: 94c5540b32eabf7bc32bfb976a268e8ea05fd6da LeadKit: a8b51716890f6d19e2b4e6e5217883d7834d4185 ObjectMapper: 92230db59bf8f341a5c3a3cf0b9fbdde3cf0d87f RxAlamofire: 6ea579ac53bf14cb4bc7049a3866e5a769989b1d RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334 - SwiftValidator: 2aa43104ac8baaaeaa297f1dc18371c063543fd9 + SwiftValidator: 46cdd2061962df3ee8bab3c536dea9b34191d459 TableKit: 42d4dff2944f273cdeec2ef6352064eb6a9a355b UIScrollView-InfiniteScroll: c132d6d5851daff229ab4a1060ccf70a05a051c9 -PODFILE CHECKSUM: 9c0c1a04355f00f95d5aebadbc3a981fcd55e150 +PODFILE CHECKSUM: 96dea11fb103a275758c4ef3e731c4cce206746d COCOAPODS: 1.3.1 diff --git a/LeadKitAdditions/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift b/LeadKitAdditions/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift index ccb7918..5ad2563 100644 --- a/LeadKitAdditions/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift +++ b/LeadKitAdditions/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift @@ -92,7 +92,7 @@ open class BasePassCodeViewController: UIViewController { .subscribe(onNext: { [weak self] _ in self?.resetUI() }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } private func enebleKeyboard() { @@ -217,7 +217,7 @@ extension BasePassCodeViewController: ConfigurableController { self?.hideError() self?.viewModel.setPassCodeText(text) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) viewModel.validationResult .drive(onNext: { [weak self] validationResult in @@ -231,13 +231,13 @@ extension BasePassCodeViewController: ConfigurableController { self?.showError(for: pasCodeError) } }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) viewModel.passCodeControllerState .drive(onNext: { [weak self] controllerState in self?.configureUI(for: controllerState) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } open func addViews() {} diff --git a/LeadKitAdditions/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift b/LeadKitAdditions/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift index f17ca41..a9d42ec 100644 --- a/LeadKitAdditions/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift +++ b/LeadKitAdditions/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift @@ -80,7 +80,7 @@ open class BasePassCodeViewModel: BaseViewModel { self?.set(passCode: passCode) } }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) validationResultHolder.asDriver() .drive(onNext: { [weak self] validationResult in @@ -105,7 +105,7 @@ open class BasePassCodeViewModel: BaseViewModel { } } }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } // MARK: - Public diff --git a/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift b/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift index 5df91f9..6e51991 100644 --- a/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift +++ b/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift @@ -61,15 +61,15 @@ public extension Observable { - retryLimit: how many times request can restarts */ func retryWithinErrors(_ errorTypes: [Error.Type] = [ConnectionError.self], - retryLimit: Int = DefaultNetworkService.retryLimit) + retryLimit: UInt = DefaultNetworkService.retryLimit) -> Observable { return observeOn(CurrentThreadScheduler.instance) .retryWhen { errors -> Observable in - return errors.flatMapWithIndex { e, a -> Observable in - let canRetry = errorTypes.contains { type(of: e) == $0 } + return errors.enumerated().flatMap { attempt, error -> Observable in + let canRetry = errorTypes.contains { type(of: error) == $0 } - return (canRetry && a < retryLimit - 1) ? self : .error(e) + return (canRetry && attempt < retryLimit - 1) ? self : .error(error) } } } @@ -82,7 +82,7 @@ public extension Observable { - handler: block, that executes, when error occured */ func handleApiError(_ apiErrorType: T, - handler: @escaping () -> Void) -> Observable + handler: @escaping () -> Void) -> Observable where T.RawValue == Int { return observeOn(CurrentThreadScheduler.instance) @@ -104,7 +104,7 @@ public extension Observable { isLoading.onNext(false) }, onError: { _ in isLoading.onNext(false) - }, onSubscribe: { _ in + }, onSubscribe: { isLoading.onNext(true) }) } diff --git a/LeadKitAdditions/Sources/Protocols/CellFieldJumpingProtocol.swift b/LeadKitAdditions/Sources/Protocols/CellFieldJumpingProtocol.swift index 39029f7..359ffe5 100644 --- a/LeadKitAdditions/Sources/Protocols/CellFieldJumpingProtocol.swift +++ b/LeadKitAdditions/Sources/Protocols/CellFieldJumpingProtocol.swift @@ -25,14 +25,14 @@ extension CellFieldJumpingProtocol { .subscribe(onNext: { [weak textField] _ in textField?.resignFirstResponder() }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) shouldBecomeFirstResponder.asObservable() .observeOn(MainScheduler.instance) .subscribe(onNext: { [weak textField] _ in textField?.becomeFirstResponder() }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } } diff --git a/LeadKitAdditions/Sources/Services/BasePassCodeService.swift b/LeadKitAdditions/Sources/Services/BasePassCodeService.swift index 13414f0..5892a7c 100644 --- a/LeadKitAdditions/Sources/Services/BasePassCodeService.swift +++ b/LeadKitAdditions/Sources/Services/BasePassCodeService.swift @@ -43,7 +43,7 @@ open class BasePassCodeService { // MARK: - Private stuff fileprivate lazy var keychain: Keychain = { - return Keychain(service: keychainService) + return Keychain(service: BasePassCodeService.keychainService) .synchronizable(false) }() diff --git a/LeadKitAdditions/Sources/Services/CellFieldsJumpingService.swift b/LeadKitAdditions/Sources/Services/CellFieldsJumpingService.swift index 692ff28..463a021 100644 --- a/LeadKitAdditions/Sources/Services/CellFieldsJumpingService.swift +++ b/LeadKitAdditions/Sources/Services/CellFieldsJumpingService.swift @@ -70,7 +70,7 @@ class CellFieldsJumpingService { .subscribe(onNext: { [weak self] in self?.shouldGoForwardAction(from: offset) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } cellFields.lastActive?.returnButtonType = .done @@ -87,30 +87,30 @@ class CellFieldsJumpingService { .subscribe(onNext: { [weak self] in self?.shouldGoForwardAction(from: index) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) - toolBar.shouldGoBackward.asObservable() + toolBar.shouldGoBackward .subscribe(onNext: { [weak self] in if let previousActive = self?.cellFields.previousActive(from: index) { - previousActive.shouldBecomeFirstResponder.onNext() + previousActive.shouldBecomeFirstResponder.onNext(Void()) } }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) - toolBar.shouldEndEditing.asObservable() - .subscribe(onNext: { - field.shouldResignFirstResponder.onNext() + toolBar.shouldEndEditing + .subscribe(onNext: { [field] in + field.shouldResignFirstResponder.onNext(Void()) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) return toolBar } private func shouldGoForwardAction(from index: Int) { if let nextActive = cellFields.nextActive(from: index) { - nextActive.shouldBecomeFirstResponder.onNext() + nextActive.shouldBecomeFirstResponder.onNext(Void()) } else { - didDone.onNext() + didDone.onNext(Void()) } } diff --git a/LeadKitAdditions/Sources/Services/MaskFieldTextProxy.swift b/LeadKitAdditions/Sources/Services/MaskFieldTextProxy.swift index a275c51..660f6e0 100644 --- a/LeadKitAdditions/Sources/Services/MaskFieldTextProxy.swift +++ b/LeadKitAdditions/Sources/Services/MaskFieldTextProxy.swift @@ -45,7 +45,7 @@ class MaskFieldTextProxy: NSObject { self?.maskedProxy.put(text: value, into: textField) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } } diff --git a/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift b/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift index 2b214b5..be13373 100644 --- a/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift +++ b/LeadKitAdditions/Sources/Services/Network/DefaultNetworkService.swift @@ -27,7 +27,9 @@ import RxSwift /// Default implementation of network service, which trust any server and use default timeout interval open class DefaultNetworkService: NetworkService { - static let retryLimit = 3 + open class var retryLimit: UInt { + return 3 + } private let disposeBag = DisposeBag() @@ -44,7 +46,7 @@ open class DefaultNetworkService: NetworkService { public override init(sessionManager: SessionManager) { super.init(sessionManager: sessionManager) - activityIndicatorBinding()?.addDisposableTo(disposeBag) + activityIndicatorBinding()?.disposed(by: disposeBag) } // MARK: - Default Values diff --git a/LeadKitAdditions/Sources/Services/ValidationService/ValidationItem.swift b/LeadKitAdditions/Sources/Services/ValidationService/ValidationItem.swift index e848cd5..85aea2c 100644 --- a/LeadKitAdditions/Sources/Services/ValidationService/ValidationItem.swift +++ b/LeadKitAdditions/Sources/Services/ValidationService/ValidationItem.swift @@ -58,7 +58,7 @@ class ValidationItem { .subscribe(onNext: { [weak self] value in self?.validate(text: value) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } @discardableResult diff --git a/LeadKitAdditions/Sources/Services/ValidationService/ValidationService.swift b/LeadKitAdditions/Sources/Services/ValidationService/ValidationService.swift index 37e5fbe..824ba75 100644 --- a/LeadKitAdditions/Sources/Services/ValidationService/ValidationService.swift +++ b/LeadKitAdditions/Sources/Services/ValidationService/ValidationService.swift @@ -97,7 +97,7 @@ class ValidationService { } .map { $0 ? ValidationServiceState.valid : .invalid } .bind(to: stateHolder) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } } diff --git a/LeadKitAdditions/Sources/Views/CellTextField/CellTextField.swift b/LeadKitAdditions/Sources/Views/CellTextField/CellTextField.swift index 0377b83..b351573 100644 --- a/LeadKitAdditions/Sources/Views/CellTextField/CellTextField.swift +++ b/LeadKitAdditions/Sources/Views/CellTextField/CellTextField.swift @@ -34,13 +34,13 @@ class CellTextField: UITextField { .drive(onNext: { viewModel.setTextValue($0) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) - rx.controlEvent(.editingDidEndOnExit).asObservable() - .subscribe(onNext: { - viewModel.shouldGoForward.onNext() + rx.controlEvent(.editingDidEndOnExit) + .subscribe(onNext: { [viewModel] in + viewModel.shouldGoForward.onNext(Void()) }) - .addDisposableTo(disposeBag) + .disposed(by: disposeBag) } } diff --git a/LeadKitAdditions/Sources/Views/CellTextFieldToolBar.swift b/LeadKitAdditions/Sources/Views/CellTextFieldToolBar.swift index da15cb9..ac2003e 100644 --- a/LeadKitAdditions/Sources/Views/CellTextFieldToolBar.swift +++ b/LeadKitAdditions/Sources/Views/CellTextFieldToolBar.swift @@ -93,15 +93,15 @@ class CellTextFieldToolBar: UIToolbar, CellFieldsToolBarProtocol { // MARK: - Actions @objc private func backAction() { - shouldGoBackward.onNext() + shouldGoBackward.onNext(Void()) } @objc private func forwardAction() { - shouldGoForward.onNext() + shouldGoForward.onNext(Void()) } @objc private func doneAction() { - shouldEndEditing.onNext() + shouldEndEditing.onNext(Void()) } }