diff --git a/.gitignore b/.gitignore index 653e319..5df8b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,6 @@ fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output + +# Touch Instinct custom +Downloads/ diff --git a/CHANGELOG.md b/CHANGELOG.md index b50fcf8..9bb9181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 0.3.14 +- **Update**: remove Carthage binary dependencies, update build scripts. + ### 0.3.13 - **[Breaking change]**: `LabelTableViewCell` moved to `LeadKit`. - **[Breaking change]**: Removed `PinLayout` dependency. diff --git a/Cartfile b/Cartfile index dfea7fe..c7be97c 100644 --- a/Cartfile +++ b/Cartfile @@ -1,10 +1,5 @@ -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftDate/SwiftDate.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKit/LeadKit.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/Alamofire/Alamofire.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/TableKit/TableKit.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxSwift/RxSwift.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/UIScrollView_InfiniteScroll/UIScrollView_InfiniteScroll.json" +github "krzyzanowskim/CryptoSwift" +github "TouchInstinct/LeadKit" +github "petropavel13/SwiftValidator" +github "kishikawakatsumi/KeychainAccess" +github "layoutBox/PinLayout" diff --git a/Cartfile.resolved b/Cartfile.resolved index e168b3e..21c02ac 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,10 +1,12 @@ -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/Alamofire/Alamofire.json" "4.8.1" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" "0.14.0" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" "3.2.0" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKit/LeadKit.json" "0.9.15" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" "4.3.0" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxSwift/RxSwift.json" "4.4.2" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftDate/SwiftDate.json" "5.1.0" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" "5.0.0" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/TableKit/TableKit.json" "2.10008.1" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/UIScrollView_InfiniteScroll/UIScrollView_InfiniteScroll.json" "1.1.0" +github "Alamofire/Alamofire" "4.9.1" +github "ReactiveX/RxSwift" "4.5.0" +github "RxSwiftCommunity/RxAlamofire" "4.5.0" +github "SnapKit/SnapKit" "4.2.0" +github "TouchInstinct/LeadKit" "0.9.29" +github "TouchInstinct/TableKit" "2.10008.1" +github "krzyzanowskim/CryptoSwift" "1.3.0" +github "malcommac/SwiftDate" "6.1.0" +github "petropavel13/SwiftValidator" "be856202cd70e6549ebc8c9d07ec47bbff784b07" +github "pronebird/UIScrollView-InfiniteScroll" "1.1.0" +github "kishikawakatsumi/KeychainAccess" "v3.2.0" +github "layoutBox/PinLayout" "1.8.6" diff --git a/LeadKitAdditions.xcodeproj/project.pbxproj b/LeadKitAdditions.xcodeproj/project.pbxproj index 1d65acf..186993c 100644 --- a/LeadKitAdditions.xcodeproj/project.pbxproj +++ b/LeadKitAdditions.xcodeproj/project.pbxproj @@ -369,7 +369,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "CONFIG_PATH=${PROJECT_DIR}/build-scripts/xcode/.swiftlint.yml\n\nif which swiftlint >/dev/null; then\nswiftlint autocorrect --path Sources --config ${CONFIG_PATH} && swiftlint --path Sources --config ${CONFIG_PATH}\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = ". run_swiftlint.sh\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift b/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift index 9e1b0e4..c0ebcdd 100644 --- a/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift +++ b/Sources/Classes/BaseTextFieldViewModel/BaseTextFieldViewModel.swift @@ -105,8 +105,7 @@ public extension BaseTextFieldViewModelEvents { } let passedRules = offlineRules - .map { $0.validate(nonEmptyString) } - .reduce(true) { $0 && $1 } + .allSatisfy { $0.validate(nonEmptyString) } guard passedRules else { return .just(.initial) diff --git a/Sources/Services/ValidationService/ValidationService.swift b/Sources/Services/ValidationService/ValidationService.swift index 29b39e2..5662744 100644 --- a/Sources/Services/ValidationService/ValidationService.swift +++ b/Sources/Services/ValidationService/ValidationService.swift @@ -71,7 +71,7 @@ public final class ValidationService { public func validate() -> Bool { validationStateReactType = .all - let isValid = validationItems.map { $0.manualValidate() }.reduce(true) { $0 && $1 } + let isValid = validationItems.allSatisfy { $0.manualValidate() } validationStateReactType = .each return isValid @@ -95,7 +95,7 @@ public final class ValidationService { stateObservables.forEach { observable in observable .map { states -> Bool in - states.map { $0.isValid }.reduce(true) { $0 && $1 } + states.allSatisfy { $0.isValid } } .map { $0 ? ValidationServiceState.valid : .invalid } .bind(to: stateHolder) diff --git a/build-scripts b/build-scripts index 54935bb..1f83bf5 160000 --- a/build-scripts +++ b/build-scripts @@ -1 +1 @@ -Subproject commit 54935bbe26063cdf04e72b8cb76d61c727ff99a7 +Subproject commit 1f83bf5d08bbc2c2346141621a42b2d2e0dd6517 diff --git a/run_swiftlint.sh b/run_swiftlint.sh new file mode 100644 index 0000000..01c1db0 --- /dev/null +++ b/run_swiftlint.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +readonly CONFIG_PATH=${PROJECT_DIR}/build-scripts/xcode/.swiftlint.yml + +readonly SWIFTLINT_VERSION=0.31.0 +readonly SWIFTLINT_PORTABLE_FILENAME=portable_swiftlint.zip + +readonly SWIFTLINT_PORTABLE_URL=https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/${SWIFTLINT_PORTABLE_FILENAME} + +. build-scripts/xcode/aux_scripts/download_file.sh ${SWIFTLINT_PORTABLE_FILENAME} ${SWIFTLINT_PORTABLE_URL} Downloads --remove-cached + +cd Downloads && unzip -o ${SWIFTLINT_PORTABLE_FILENAME} + +${PROJECT_DIR}/Downloads/swiftlint autocorrect --path ${PROJECT_DIR}/Sources --config ${CONFIG_PATH} && ${PROJECT_DIR}/Downloads/swiftlint --path ${PROJECT_DIR}/Sources --config ${CONFIG_PATH} \ No newline at end of file