From ed3198647782195f11bd0f902079e8edbd3c0243 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Mon, 25 Sep 2017 20:15:51 +0300 Subject: [PATCH 1/6] Swift 4 support --- LeadKit.podspec | 20 +++---- LeadKit.xcodeproj/project.pbxproj | 29 +++++----- Podfile | 10 ++-- Podfile.lock | 56 +++++++++++-------- .../Pagination/PaginationViewModel.swift | 2 +- .../CGContext/CGContext+Initializers.swift | 2 +- .../Sequence/Sequence+ConcurrentMap.swift | 2 +- .../String/String+SizeCalculation.swift | 4 +- Sources/Functions/Any+TypeName.swift | 6 +- Sources/Info-iOS.plist | 2 +- 10 files changed, 71 insertions(+), 62 deletions(-) diff --git a/LeadKit.podspec b/LeadKit.podspec index d03c2f32..ac60ff01 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.5.7" + s.version = "0.6.0" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" @@ -77,12 +77,12 @@ Pod::Spec.new do |s| ] ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' - ss.dependency "RxSwift", '3.4.0' - ss.dependency "RxCocoa", '3.4.0' - ss.dependency "RxAlamofire", '3.0.2' - ss.dependency "ObjectMapper", '~> 2.2' + ss.dependency "RxSwift", '4.0.0-beta.0' + ss.dependency "RxCocoa", '4.0.0-beta.0' + ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "ObjectMapper", '~> 3.0.0' - ss.ios.dependency "TableKit", '~> 2.3.1' + ss.ios.dependency "TableKit", '~> 2.5.0' ss.ios.dependency "UIScrollView-InfiniteScroll", '~> 1.0.0' end @@ -99,10 +99,10 @@ Pod::Spec.new do |s| ] ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' - ss.dependency "RxSwift", '3.4.0' - ss.dependency "RxCocoa", '3.4.0' - ss.dependency "RxAlamofire", '3.0.2' - ss.dependency "ObjectMapper", '~> 2.2' + ss.dependency "RxSwift", '4.0.0-beta.0' + ss.dependency "RxCocoa", '4.0.0-beta.0' + ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "ObjectMapper", '~> 3.0.0' end s.default_subspec = 'Core' diff --git a/LeadKit.xcodeproj/project.pbxproj b/LeadKit.xcodeproj/project.pbxproj index 32475e1f..4d5215f5 100644 --- a/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit.xcodeproj/project.pbxproj @@ -1227,7 +1227,6 @@ children = ( A6F32C0E1F6EBE8E00AC08EE /* StringExtensionTests.swift */, ); - name = Extensions; path = Extensions; sourceTree = ""; }; @@ -2470,7 +2469,7 @@ PRODUCT_NAME = LeadKit; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -2494,7 +2493,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS"; PRODUCT_NAME = LeadKit; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -2514,7 +2513,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -2532,7 +2531,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -2558,7 +2557,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -2585,7 +2584,7 @@ PRODUCT_NAME = LeadKit; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -2612,7 +2611,7 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -2638,7 +2637,7 @@ PRODUCT_NAME = LeadKit; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -2660,7 +2659,7 @@ SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TVOS_DEPLOYMENT_TARGET = 10.2; }; name = Debug; @@ -2679,7 +2678,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TVOS_DEPLOYMENT_TARGET = 10.2; }; name = Release; @@ -2706,7 +2705,7 @@ PRODUCT_NAME = LeadKit; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -2731,7 +2730,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS-Extensions"; PRODUCT_NAME = LeadKit; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -2749,7 +2748,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS-ExtensionsTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -2766,7 +2765,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS-ExtensionsTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Podfile b/Podfile index 25498f6e..05915ba9 100644 --- a/Podfile +++ b/Podfile @@ -1,9 +1,9 @@ abstract_target 'LeadKit' do pod "CocoaLumberjack/Swift", '~> 3.1.0' - pod "RxSwift", '3.4.0' - pod "RxCocoa", '3.4.0' - pod "RxAlamofire", '3.0.2' - pod "ObjectMapper", '~> 2.2' + pod "RxSwift", '4.0.0-beta.0' + pod "RxCocoa", '4.0.0-beta.0' + pod "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + pod "ObjectMapper", '~> 3.0.0' inhibit_all_warnings! @@ -12,7 +12,7 @@ abstract_target 'LeadKit' do use_frameworks! - pod "TableKit", '~> 2.3.1' + pod "TableKit", '~> 2.5.0' pod "UIScrollView-InfiniteScroll", '~> 1.0.0' target 'LeadKit iOSTests' do diff --git a/Podfile.lock b/Podfile.lock index 0318a20b..9a81e0fd 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,39 +1,49 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.1) - CocoaLumberjack/Default (3.1.0) - CocoaLumberjack/Swift (3.1.0): - CocoaLumberjack/Default - - ObjectMapper (2.2.6) - - 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) - - TableKit (2.3.1) + - ObjectMapper (3.0.0) + - RxAlamofire (4.0.0): + - RxAlamofire/Core (= 4.0.0) + - RxAlamofire/Core (4.0.0): + - Alamofire (~> 4.5.1) + - RxSwift (~> 4.0.0-beta.0) + - RxCocoa (4.0.0-beta.0): + - RxSwift (~> 4.0.0-beta.0) + - RxSwift (4.0.0-beta.0) + - TableKit (2.5.0) - UIScrollView-InfiniteScroll (1.0.1) DEPENDENCIES: - CocoaLumberjack/Swift (~> 3.1.0) - - ObjectMapper (~> 2.2) - - RxAlamofire (= 3.0.2) - - RxCocoa (= 3.4.0) - - RxSwift (= 3.4.0) - - TableKit (~> 2.3.1) + - ObjectMapper (~> 3.0.0) + - RxAlamofire (from `https://github.com/RxSwiftCommunity/RxAlamofire.git`, commit `c2fdccf8058d1a61f5fbb540054c21372de1151d`) + - RxCocoa (= 4.0.0-beta.0) + - RxSwift (= 4.0.0-beta.0) + - TableKit (~> 2.5.0) - UIScrollView-InfiniteScroll (~> 1.0.0) +EXTERNAL SOURCES: + RxAlamofire: + :commit: c2fdccf8058d1a61f5fbb540054c21372de1151d + :git: https://github.com/RxSwiftCommunity/RxAlamofire.git + +CHECKOUT OPTIONS: + RxAlamofire: + :commit: c2fdccf8058d1a61f5fbb540054c21372de1151d + :git: https://github.com/RxSwiftCommunity/RxAlamofire.git + SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a CocoaLumberjack: 8311463ddf9ee86a06ef92a071dd656c89244500 - ObjectMapper: 042708195cc46c20871cbcbec0453826398273fd - RxAlamofire: bc53604b29fd2d220cfaa490c736cc4500819f34 - RxCocoa: d14ef6b6029e1ddc6e966508c09289090de68ff9 - RxSwift: 3789a1af753002a14edecdb698a2424624296a9c - TableKit: 02e041b443f75fa3e9f1ee6024d4b256305bd904 + ObjectMapper: 92230db59bf8f341a5c3a3cf0b9fbdde3cf0d87f + RxAlamofire: c50217ed8ebd04888e2ab4b995d0eaeb178895fd + RxCocoa: 8d809675f4e89c5c4c5a6900bbd11fe632ad5d86 + RxSwift: e0899fae37065c16db976cc5e3c957e4e388869c + TableKit: 42d4dff2944f273cdeec2ef6352064eb6a9a355b UIScrollView-InfiniteScroll: a90df4ba4a7ca1926128ade34a850ddbdf74c564 -PODFILE CHECKSUM: 911be4683d2ba9315350d42e9576f7517da3f756 +PODFILE CHECKSUM: c23a86e5adf05dabfc4d378f98a2fd90a58ad753 COCOAPODS: 1.3.1 diff --git a/Sources/Classes/Pagination/PaginationViewModel.swift b/Sources/Classes/Pagination/PaginationViewModel.swift index 75407802..14178ae3 100644 --- a/Sources/Classes/Pagination/PaginationViewModel.swift +++ b/Sources/Classes/Pagination/PaginationViewModel.swift @@ -100,7 +100,7 @@ public final class PaginationViewModel { case .retry: reload(isRetry: true) case .next: - if case .exhausted(_) = internalState.value { + if case .exhausted = internalState.value { fatalError("You shouldn't call load(.next) after got .exhausted state!") } diff --git a/Sources/Extensions/CGContext/CGContext+Initializers.swift b/Sources/Extensions/CGContext/CGContext+Initializers.swift index 4730ff15..55bab22b 100644 --- a/Sources/Extensions/CGContext/CGContext+Initializers.swift +++ b/Sources/Extensions/CGContext/CGContext+Initializers.swift @@ -22,7 +22,7 @@ import CoreGraphics -extension CGBitmapInfo { +public extension CGBitmapInfo { // The bitmapInfo value are hard-coded to prevent an "unsupported parameter combination" error diff --git a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift index 6d41ed36..03afb995 100644 --- a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift +++ b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift @@ -59,7 +59,7 @@ public extension Sequence { .map { (idx: $0.idx, results: try array[$0.range].map(transform)) } } .toArray() - .map { $0.sorted { $0.0.idx < $0.1.idx }.flatMap { $0.results } } + .map { $0.sorted { $0.idx < $1.idx } .flatMap { $0.results } } } } diff --git a/Sources/Extensions/String/String+SizeCalculation.swift b/Sources/Extensions/String/String+SizeCalculation.swift index 5e197d88..a8054ffc 100644 --- a/Sources/Extensions/String/String+SizeCalculation.swift +++ b/Sources/Extensions/String/String+SizeCalculation.swift @@ -65,7 +65,7 @@ public extension String { - returns: string size calculation result */ - public func size(withAttributes attributes: [String: AnyObject]?, + public func size(withAttributes attributes: [NSAttributedStringKey: Any]?, maxWidth: CGFloat = CGFloat.greatestFiniteMagnitude, maxHeight: CGFloat = CGFloat.greatestFiniteMagnitude) -> StringSizeCalculationResult { @@ -74,7 +74,7 @@ public extension String { attributes: attributes, context: nil).size - let fontLineHeight = (attributes?[NSFontAttributeName] as? UIFont)?.lineHeight + let fontLineHeight = (attributes?[NSAttributedStringKey.font] as? UIFont)?.lineHeight return StringSizeCalculationResult(size: size, fontLineHeight: fontLineHeight) } diff --git a/Sources/Functions/Any+TypeName.swift b/Sources/Functions/Any+TypeName.swift index e117bd83..d4f41a59 100644 --- a/Sources/Functions/Any+TypeName.swift +++ b/Sources/Functions/Any+TypeName.swift @@ -26,11 +26,11 @@ import Foundation /// /// - Parameter type: an object type /// - Returns: string representation of object type -public func className(of type: T) -> String { - let clsName = String(describing: type(of: type)) +public func className(of givenType: T) -> String { + let clsName = String(describing: type(of: givenType)) if let typeRange = clsName.range(of: ".Type") { - return clsName.substring(to: typeRange.lowerBound) + return String(clsName[..CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.0 + 0.6.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass From 716b3060349be523f69fe44232bd9bfc5dd0d65f Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Mon, 25 Sep 2017 20:45:26 +0300 Subject: [PATCH 2/6] Dependency branch fixed --- LeadKit.podspec | 4 ++-- Podfile | 2 +- Podfile.lock | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LeadKit.podspec b/LeadKit.podspec index ac60ff01..a7e60106 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -79,7 +79,7 @@ Pod::Spec.new do |s| ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' ss.dependency "RxSwift", '4.0.0-beta.0' ss.dependency "RxCocoa", '4.0.0-beta.0' - ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' ss.dependency "ObjectMapper", '~> 3.0.0' ss.ios.dependency "TableKit", '~> 2.5.0' @@ -101,7 +101,7 @@ Pod::Spec.new do |s| ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' ss.dependency "RxSwift", '4.0.0-beta.0' ss.dependency "RxCocoa", '4.0.0-beta.0' - ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' ss.dependency "ObjectMapper", '~> 3.0.0' end diff --git a/Podfile b/Podfile index 05915ba9..48ab2d1c 100644 --- a/Podfile +++ b/Podfile @@ -2,7 +2,7 @@ abstract_target 'LeadKit' do pod "CocoaLumberjack/Swift", '~> 3.1.0' pod "RxSwift", '4.0.0-beta.0' pod "RxCocoa", '4.0.0-beta.0' - pod "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + pod "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' pod "ObjectMapper", '~> 3.0.0' inhibit_all_warnings! diff --git a/Podfile.lock b/Podfile.lock index 9a81e0fd..e8e815fb 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -18,7 +18,7 @@ PODS: DEPENDENCIES: - CocoaLumberjack/Swift (~> 3.1.0) - ObjectMapper (~> 3.0.0) - - RxAlamofire (from `https://github.com/RxSwiftCommunity/RxAlamofire.git`, commit `c2fdccf8058d1a61f5fbb540054c21372de1151d`) + - RxAlamofire (from `https://github.com/RxSwiftCommunity/RxAlamofire.git`, commit `c2fdccf8058d1a61f5fbb540054c21372de1151d`, branch `master`) - RxCocoa (= 4.0.0-beta.0) - RxSwift (= 4.0.0-beta.0) - TableKit (~> 2.5.0) @@ -26,6 +26,7 @@ DEPENDENCIES: EXTERNAL SOURCES: RxAlamofire: + :branch: master :commit: c2fdccf8058d1a61f5fbb540054c21372de1151d :git: https://github.com/RxSwiftCommunity/RxAlamofire.git @@ -44,6 +45,6 @@ SPEC CHECKSUMS: TableKit: 42d4dff2944f273cdeec2ef6352064eb6a9a355b UIScrollView-InfiniteScroll: a90df4ba4a7ca1926128ade34a850ddbdf74c564 -PODFILE CHECKSUM: c23a86e5adf05dabfc4d378f98a2fd90a58ad753 +PODFILE CHECKSUM: 7dc5da62d5fcaacd2ad35126235ca1fbf9c0aab8 COCOAPODS: 1.3.1 From 001a6f206af63d0a8d20473def54ddb11812ea7f Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 18 Oct 2017 19:17:31 +0300 Subject: [PATCH 3/6] update project to recommended settings --- LeadKit.xcodeproj/project.pbxproj | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/LeadKit.xcodeproj/project.pbxproj b/LeadKit.xcodeproj/project.pbxproj index 6f9d0b86..8297957b 100644 --- a/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit.xcodeproj/project.pbxproj @@ -1572,7 +1572,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Touch Instinct"; TargetAttributes = { 67186B271EB248F100CFAFFB = { @@ -2891,14 +2891,20 @@ 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_EMPTY_BODY = YES; 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; @@ -2941,14 +2947,20 @@ 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_EMPTY_BODY = YES; 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; From 63c6a5b0295ed19f41820b9b1790401526a79b09 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 18 Oct 2017 19:29:53 +0300 Subject: [PATCH 4/6] update dependencies --- LeadKit.podspec | 8 ++++---- Podfile | 8 ++++---- Podfile.lock | 47 ++++++++++++++++++----------------------------- 3 files changed, 26 insertions(+), 37 deletions(-) diff --git a/LeadKit.podspec b/LeadKit.podspec index d332242b..f6d3605c 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -110,10 +110,10 @@ Pod::Spec.new do |s| "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift" ] - ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' - ss.dependency "RxSwift", '4.0.0-beta.0' - ss.dependency "RxCocoa", '4.0.0-beta.0' - ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "CocoaLumberjack/Swift", '~> 3.3.0' + ss.dependency "RxSwift", '4.0.0' + ss.dependency "RxCocoa", '4.0.0' + ss.dependency "RxAlamofire", '4.0.0' ss.dependency "ObjectMapper", '~> 3.0.0' end diff --git a/Podfile b/Podfile index 48ab2d1c..d7268a90 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,8 @@ abstract_target 'LeadKit' do - pod "CocoaLumberjack/Swift", '~> 3.1.0' - pod "RxSwift", '4.0.0-beta.0' - pod "RxCocoa", '4.0.0-beta.0' - pod "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + pod "CocoaLumberjack/Swift", '~> 3.3.0' + pod "RxSwift", '4.0.0' + pod "RxCocoa", '4.0.0' + pod "RxAlamofire", '4.0.0' pod "ObjectMapper", '~> 3.0.0' inhibit_all_warnings! diff --git a/Podfile.lock b/Podfile.lock index e8e815fb..482a38d2 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,50 +1,39 @@ 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 - ObjectMapper (3.0.0) - RxAlamofire (4.0.0): - RxAlamofire/Core (= 4.0.0) - RxAlamofire/Core (4.0.0): - - Alamofire (~> 4.5.1) - - RxSwift (~> 4.0.0-beta.0) - - RxCocoa (4.0.0-beta.0): - - RxSwift (~> 4.0.0-beta.0) - - RxSwift (4.0.0-beta.0) + - Alamofire (~> 4.5) + - RxSwift (~> 4.0) + - RxCocoa (4.0.0): + - RxSwift (~> 4.0) + - RxSwift (4.0.0) - TableKit (2.5.0) - - UIScrollView-InfiniteScroll (1.0.1) + - UIScrollView-InfiniteScroll (1.0.2) DEPENDENCIES: - - CocoaLumberjack/Swift (~> 3.1.0) + - CocoaLumberjack/Swift (~> 3.3.0) - ObjectMapper (~> 3.0.0) - - RxAlamofire (from `https://github.com/RxSwiftCommunity/RxAlamofire.git`, commit `c2fdccf8058d1a61f5fbb540054c21372de1151d`, branch `master`) - - RxCocoa (= 4.0.0-beta.0) - - RxSwift (= 4.0.0-beta.0) + - RxAlamofire (= 4.0.0) + - RxCocoa (= 4.0.0) + - RxSwift (= 4.0.0) - TableKit (~> 2.5.0) - UIScrollView-InfiniteScroll (~> 1.0.0) -EXTERNAL SOURCES: - RxAlamofire: - :branch: master - :commit: c2fdccf8058d1a61f5fbb540054c21372de1151d - :git: https://github.com/RxSwiftCommunity/RxAlamofire.git - -CHECKOUT OPTIONS: - RxAlamofire: - :commit: c2fdccf8058d1a61f5fbb540054c21372de1151d - :git: https://github.com/RxSwiftCommunity/RxAlamofire.git - SPEC CHECKSUMS: Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a - CocoaLumberjack: 8311463ddf9ee86a06ef92a071dd656c89244500 + CocoaLumberjack: 3c8c74683302f9012bb168e1c4b7ae3c0b558431 ObjectMapper: 92230db59bf8f341a5c3a3cf0b9fbdde3cf0d87f - RxAlamofire: c50217ed8ebd04888e2ab4b995d0eaeb178895fd - RxCocoa: 8d809675f4e89c5c4c5a6900bbd11fe632ad5d86 - RxSwift: e0899fae37065c16db976cc5e3c957e4e388869c + RxAlamofire: 6ea579ac53bf14cb4bc7049a3866e5a769989b1d + RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e + RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334 TableKit: 42d4dff2944f273cdeec2ef6352064eb6a9a355b - UIScrollView-InfiniteScroll: a90df4ba4a7ca1926128ade34a850ddbdf74c564 + UIScrollView-InfiniteScroll: c132d6d5851daff229ab4a1060ccf70a05a051c9 -PODFILE CHECKSUM: 7dc5da62d5fcaacd2ad35126235ca1fbf9c0aab8 +PODFILE CHECKSUM: ef8520adc4869bbbf0cf4cf70ab5757b0c95be1f COCOAPODS: 1.3.1 From a1b9cc762d6eafd2dab99c52b382703d8811f1c0 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 18 Oct 2017 19:30:01 +0300 Subject: [PATCH 5/6] update changelog --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2066e38e..01aacae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,42 +1,19 @@ # Changelog -## 0.5.6 +## 0.6.0 +- **New**: Swift 4 support & dependencies update -- **Fix**: Clear tableview if placeholder is shown +## 0.5.18 +- **Fix**: EmptyCell first appearance setup fix -## 0.5.7 +## 0.5.17 +- **Fix**: EmptyCell reusing appearance fix +- **Fix**: SeparatorCell reusing separators fix -- **Add**: String extension `localizedComponent(value:stringOne:stringTwo:stringMany:)` +## 0.5.16 -## 0.5.8 - -- **Fix**: Synchronization over `NSRecursiveLock` for request count tracker in NetworkService - -## 0.5.9 - -- **Fix**: One-two-many fixed for values more than 99 - -## 0.5.10 - -- **Fix**: `Public` modifier for `SpinnerView` - -## 0.5.11 - -- **[Breaking Change]**: rename initializer from `init(initialFrom:)` to `init(resetFrom:)` in `ResettableType` -- **Add**: `SeparatorCell` with `SeparatorCellViewModel` -- **Add**: `AnyBaseTableRow` for type-erasure -- **Add**: `EmptyCellRow` for empty cell with static height - -## 0.5.12 - -- **Fix**: Update type of `viewModel` in `ConfigurableController` to `ImplicitlyUwrappedOptional` instead of `ViewModelT` - -## 0.5.13 - -- **Change**: Remove type erasure behavior from `AnyBaseTableRow` -- **Change**: Rename `AnyBaseTableRow` class to `SeparatorRowBox` -- **Change**: Move `anyRow` property from `EmptyCellRow` to `TableRow` extension and rename it to `separatorRowBox`. -- **Change**: Move `configure(extreme: middle:)` method from `TableDirector` extension to `Array` extension and rename it to `configureSeparators(extreme: middle:)` +- **Change**: Rename `AppearanceProtocol` to `AppearanceConfigurable` +- **Add**: `subscript(safe:)` subscript to `Array` extension for safe access to element by index ## 0.5.15 @@ -45,14 +22,43 @@ - **Add**: `Appearance` to `EmptyCell` - **Remove**: `SeparatorCellViewModel`. -## 0.5.16 +## 0.5.13 + +- **Change**: Remove type erasure behavior from `AnyBaseTableRow` +- **Change**: Rename `AnyBaseTableRow` class to `SeparatorRowBox` +- **Change**: Move `anyRow` property from `EmptyCellRow` to `TableRow` extension and rename it to `separatorRowBox`. +- **Change**: Move `configure(extreme: middle:)` method from `TableDirector` extension to `Array` extension and rename it to `configureSeparators(extreme: middle:)` + +## 0.5.12 + +- **Fix**: Update type of `viewModel` in `ConfigurableController` to `ImplicitlyUwrappedOptional` instead of `ViewModelT` + +## 0.5.11 + +- **[Breaking Change]**: rename initializer from `init(initialFrom:)` to `init(resetFrom:)` in `ResettableType` +- **Add**: `SeparatorCell` with `SeparatorCellViewModel` +- **Add**: `AnyBaseTableRow` for type-erasure +- **Add**: `EmptyCellRow` for empty cell with static height + +## 0.5.10 + +- **Fix**: `Public` modifier for `SpinnerView` + +## 0.5.9 + +- **Fix**: One-two-many fixed for values more than 99 + +## 0.5.8 + +- **Fix**: Synchronization over `NSRecursiveLock` for request count tracker in NetworkService + +## 0.5.7 + +- **Add**: String extension `localizedComponent(value:stringOne:stringTwo:stringMany:)` + +## 0.5.6 + +- **Fix**: Clear tableview if placeholder is shown -- **Change**: Rename `AppearanceProtocol` to `AppearanceConfigurable` -- **Add**: `subscript(safe:)` subscript to `Array` extension for safe access to element by index -## 0.5.17 -- **Fix**: EmptyCell reusing appearance fix -- **Fix**: SeparatorCell reusing separators fix -## 0.5.18 -- **Fix**: EmptyCell first appearance setup fix From 4772993e9ba3173783792cd3b443f55760f8f597 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 18 Oct 2017 19:34:32 +0300 Subject: [PATCH 6/6] fix dependencies --- LeadKit.podspec | 8 ++++---- Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LeadKit.podspec b/LeadKit.podspec index f6d3605c..cadea6cb 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -84,10 +84,10 @@ Pod::Spec.new do |s| "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift" ] - ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' - ss.dependency "RxSwift", '4.0.0-beta.0' - ss.dependency "RxCocoa", '4.0.0-beta.0' - ss.dependency "RxAlamofire", :git => 'https://github.com/RxSwiftCommunity/RxAlamofire.git', :branch => 'master', :commit => 'c2fdccf8058d1a61f5fbb540054c21372de1151d' + ss.dependency "CocoaLumberjack/Swift", '~> 3.3.0' + ss.dependency "RxSwift", '4.0.0' + ss.dependency "RxCocoa", '4.0.0' + ss.dependency "RxAlamofire", '4.0.0' ss.dependency "ObjectMapper", '~> 3.0.0' ss.ios.dependency "TableKit", '~> 2.5.0' diff --git a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift index 03afb995..a2b29025 100644 --- a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift +++ b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift @@ -59,7 +59,7 @@ public extension Sequence { .map { (idx: $0.idx, results: try array[$0.range].map(transform)) } } .toArray() - .map { $0.sorted { $0.idx < $1.idx } .flatMap { $0.results } } + .map { $0.sorted { $0.idx < $1.idx }.flatMap { $0.results } } } }