From 61ae9439d3be613f5cd6b46c07c80ad422573eff Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Thu, 28 Mar 2019 12:41:09 +0300 Subject: [PATCH] migrate to swift 5 --- .swift-version | 2 +- CHANGELOG.md | 3 +++ Cartfile | 22 +++++++++---------- Cartfile.resolved | 22 +++++++++---------- LeadKitAdditions.podspec | 2 +- LeadKitAdditions.xcodeproj/project.pbxproj | 13 ++++++----- .../xcschemes/LeadKitAdditions iOS.xcscheme | 2 +- Sources/Info-iOS.plist | 2 +- .../LegacyConfigurableController.swift | 2 +- .../ValidationService/ValidationService.swift | 2 +- 10 files changed, 39 insertions(+), 33 deletions(-) diff --git a/.swift-version b/.swift-version index bf77d54..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.2 +5.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d08f7..9c0996f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 0.3.12 +- **Update**: Swift 5 support + ### 0.3.11 - **Add**: Carthage support. - **[Breaking change]**: Remove `BaseDateFormatter`. Use `NumberFormattingService` from LeadKit instead. diff --git a/Cartfile b/Cartfile index 0165832..421fe1d 100644 --- a/Cartfile +++ b/Cartfile @@ -1,11 +1,11 @@ -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftDate/SwiftDate.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKit/LeadKit.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Alamofire/Alamofire.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/PinLayout/PinLayout.json" -github "ReactiveX/RxSwift" -github "maxsokolov/TableKit" -github "pronebird/UIScrollView-InfiniteScroll" +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/PinLayout/PinLayout.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" diff --git a/Cartfile.resolved b/Cartfile.resolved index e95cf8f..a7f63b9 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,11 +1,11 @@ -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Alamofire/Alamofire.json" "4.8.1" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" "0.14.0" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" "3.1.2" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKit/LeadKit.json" "0.9.7" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/PinLayout/PinLayout.json" "1.8.6" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" "4.3.0" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftDate/SwiftDate.json" "5.1.0" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" "5.0.0" -github "ReactiveX/RxSwift" "4.4.0" -github "maxsokolov/TableKit" "2.8.1" -github "pronebird/UIScrollView-InfiniteScroll" "1.1.0" +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.1.2" +binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKit/LeadKit.json" "0.9.12" +binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/PinLayout/PinLayout.json" "1.8.6" +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" diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index ebd5295..43ab118 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKitAdditions" - s.version = "0.3.11" + s.version = "0.3.12" 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/LeadKitAdditions.xcodeproj/project.pbxproj b/LeadKitAdditions.xcodeproj/project.pbxproj index 03019c6..363da88 100644 --- a/LeadKitAdditions.xcodeproj/project.pbxproj +++ b/LeadKitAdditions.xcodeproj/project.pbxproj @@ -373,22 +373,23 @@ CAE698DA1E968820000394B0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = TouchInstinct; TargetAttributes = { CAE698E21E968820000394B0 = { CreatedOnToolsVersion = 8.3; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; }; }; buildConfigurationList = CAE698DD1E968820000394B0 /* Build configuration list for PBXProject "LeadKitAdditions" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = CAE698D91E968820000394B0; productRefGroup = CAE698E41E968820000394B0 /* Products */; @@ -472,6 +473,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -534,6 +536,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -609,7 +612,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -636,7 +639,7 @@ PRODUCT_NAME = LeadKitAdditions; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/LeadKitAdditions.xcodeproj/xcshareddata/xcschemes/LeadKitAdditions iOS.xcscheme b/LeadKitAdditions.xcodeproj/xcshareddata/xcschemes/LeadKitAdditions iOS.xcscheme index 2acb502..1c54042 100644 --- a/LeadKitAdditions.xcodeproj/xcshareddata/xcschemes/LeadKitAdditions iOS.xcscheme +++ b/LeadKitAdditions.xcodeproj/xcshareddata/xcschemes/LeadKitAdditions iOS.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.3.11 + 0.3.12 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Protocols/LegacyConfigurableController.swift b/Sources/Protocols/LegacyConfigurableController.swift index 834db70..4258a18 100644 --- a/Sources/Protocols/LegacyConfigurableController.swift +++ b/Sources/Protocols/LegacyConfigurableController.swift @@ -36,7 +36,7 @@ public protocol LegacyConfigurableController: InitializableView { public extension LegacyConfigurableController where Self: UIViewController { func initializeView() { - assertionFailure("Use \(initialLoadView) for UIViewController instead!") + assertionFailure("Use \(String(describing: initialLoadView)) for UIViewController instead!") } /// Method that should be called in viewDidLoad method of UIViewController. diff --git a/Sources/Services/ValidationService/ValidationService.swift b/Sources/Services/ValidationService/ValidationService.swift index 8301396..29b39e2 100644 --- a/Sources/Services/ValidationService/ValidationService.swift +++ b/Sources/Services/ValidationService/ValidationService.swift @@ -61,7 +61,7 @@ public final class ValidationService { public func unregister(items: [ValidationItem]) { items.forEach { item in - if let removeIndex = validationItems.index(where: { $0 === item }) { + if let removeIndex = validationItems.firstIndex(where: { $0 === item }) { validationItems.remove(at: removeIndex) } }