From 1b6d77f34c8013c5003b29294f02fc3d4658a31a Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Sun, 17 Mar 2019 13:57:31 +0500 Subject: [PATCH 1/7] Blocks fix --- Sources/Functions/Block.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/Functions/Block.swift b/Sources/Functions/Block.swift index 06d3620e..e8a89711 100644 --- a/Sources/Functions/Block.swift +++ b/Sources/Functions/Block.swift @@ -23,14 +23,11 @@ /// Closure with custom arguments and return value. public typealias Block = (Input) -> Output -/// Closure with no arguments and custom return value. -public typealias ResultBlock = Block - /// Closure that takes custom arguments and returns Void. public typealias ParameterBlock = Block /// Closure that takes no arguments and returns Void. -public typealias VoidBlock = ResultBlock +public typealias VoidBlock = () -> Void /// Closure with custom arguments and return value, may throw an error. public typealias ThrowableBlock = (Input) throws -> Output From a21847b7ff62e6aa4a7ada2c5b7f2347e815181a Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Sun, 17 Mar 2019 14:09:08 +0500 Subject: [PATCH 2/7] Added case iterable --- .../NumberFormattingService+DefaultImplementation.swift | 2 +- Sources/Protocols/NumberFormattingService/NumberFormat.swift | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/Extensions/NumberFormattingService/NumberFormattingService+DefaultImplementation.swift b/Sources/Extensions/NumberFormattingService/NumberFormattingService+DefaultImplementation.swift index 8908bf2e..e8302f51 100644 --- a/Sources/Extensions/NumberFormattingService/NumberFormattingService+DefaultImplementation.swift +++ b/Sources/Extensions/NumberFormattingService/NumberFormattingService+DefaultImplementation.swift @@ -26,7 +26,7 @@ public extension NumberFormattingService { /// Computed static property. Use only once for `formatters` field implementation! static var computedFormatters: [NumberFormatType: NumberFormatter] { - return Dictionary(uniqueKeysWithValues: NumberFormatType.allOptions.map { ($0, $0.numberFormatter) }) + return Dictionary(uniqueKeysWithValues: NumberFormatType.allCases.map { ($0, $0.numberFormatter) }) } func numberFormatter(for format: NumberFormatType) -> NumberFormatter { diff --git a/Sources/Protocols/NumberFormattingService/NumberFormat.swift b/Sources/Protocols/NumberFormattingService/NumberFormat.swift index 91ced382..818eb65a 100644 --- a/Sources/Protocols/NumberFormattingService/NumberFormat.swift +++ b/Sources/Protocols/NumberFormattingService/NumberFormat.swift @@ -23,10 +23,7 @@ import Foundation /// Protocol for describing number format. -public protocol NumberFormat: Hashable { - - /// All available options. - static var allOptions: [Self] { get } +public protocol NumberFormat: Hashable, CaseIterable { /// A NumberFormatter instance for this format. var numberFormatter: NumberFormatter { get } From a73baf825366beff7b21129783ec693e0033e320 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Sun, 17 Mar 2019 14:17:21 +0500 Subject: [PATCH 3/7] Version up --- CHANGELOG.md | 4 ++++ LeadKit.podspec | 2 +- Sources/Info-iOS.plist | 2 +- Sources/Info-tvOS.plist | 2 +- Sources/Info-watchOS.plist | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0fa931f..96f7c497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 0.9.11 +- **[Breaking change]**: Renamed `NumberFormat`'s `allOptions` to `allCases` +- **Fix**: Closure syntax fix + ### 0.9.10 - **Remove**: Removed unused scheme & target - **Remove**: Cocoapods deintegrated diff --git a/LeadKit.podspec b/LeadKit.podspec index 79a14220..b9217b30 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.9.10" + s.version = "0.9.11" 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" diff --git a/Sources/Info-iOS.plist b/Sources/Info-iOS.plist index 4675ccda..968be549 100644 --- a/Sources/Info-iOS.plist +++ b/Sources/Info-iOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.10 + 0.9.11 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Info-tvOS.plist b/Sources/Info-tvOS.plist index 4675ccda..968be549 100644 --- a/Sources/Info-tvOS.plist +++ b/Sources/Info-tvOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.10 + 0.9.11 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Info-watchOS.plist b/Sources/Info-watchOS.plist index 4675ccda..968be549 100644 --- a/Sources/Info-watchOS.plist +++ b/Sources/Info-watchOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.10 + 0.9.11 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass From 517e9619ae35cfdd7dab305638168a2f6c817ee7 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Mon, 18 Mar 2019 14:49:32 +0500 Subject: [PATCH 4/7] Naming fix --- Sources/Functions/Block.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Functions/Block.swift b/Sources/Functions/Block.swift index e8a89711..bdb95203 100644 --- a/Sources/Functions/Block.swift +++ b/Sources/Functions/Block.swift @@ -21,16 +21,16 @@ // /// Closure with custom arguments and return value. -public typealias Block = (Input) -> Output +public typealias Closure = (Input) -> Output /// Closure that takes custom arguments and returns Void. -public typealias ParameterBlock = Block +public typealias ParameterClosure = Closure /// Closure that takes no arguments and returns Void. public typealias VoidBlock = () -> Void /// Closure with custom arguments and return value, may throw an error. -public typealias ThrowableBlock = (Input) throws -> Output +public typealias ThrowableClosure = (Input) throws -> Output /// Closure that takes no arguments, may throw an error and returns Void. public typealias ThrowableVoidBlock = () throws -> Void From 6556d8368b3ae93f6e8823b8513257f4bc3fdee2 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 19 Mar 2019 15:05:41 +0500 Subject: [PATCH 5/7] PR fixes --- CHANGELOG.md | 2 +- Sources/Functions/Block.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f7c497..7f3e9f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### 0.9.11 - **[Breaking change]**: Renamed `NumberFormat`'s `allOptions` to `allCases` -- **Fix**: Closure syntax fix +- **Fix**: Closure syntax fix. New closure naming. ### 0.9.10 - **Remove**: Removed unused scheme & target diff --git a/Sources/Functions/Block.swift b/Sources/Functions/Block.swift index bdb95203..5cc19334 100644 --- a/Sources/Functions/Block.swift +++ b/Sources/Functions/Block.swift @@ -23,6 +23,9 @@ /// Closure with custom arguments and return value. public typealias Closure = (Input) -> Output +/// Closure with no arguments and custom return value. +public typealias ResultBlock = () -> Output + /// Closure that takes custom arguments and returns Void. public typealias ParameterClosure = Closure From 2df2979d8f1ceb58a2315b009b813a636005b0c7 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 19 Mar 2019 15:33:49 +0500 Subject: [PATCH 6/7] Naming fix --- Sources/Functions/Block.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Functions/Block.swift b/Sources/Functions/Block.swift index 5cc19334..98c2e15f 100644 --- a/Sources/Functions/Block.swift +++ b/Sources/Functions/Block.swift @@ -24,13 +24,13 @@ public typealias Closure = (Input) -> Output /// Closure with no arguments and custom return value. -public typealias ResultBlock = () -> Output +public typealias ResultClosure = () -> Output /// Closure that takes custom arguments and returns Void. public typealias ParameterClosure = Closure /// Closure that takes no arguments and returns Void. -public typealias VoidBlock = () -> Void +public typealias VoidBlock = ResultClosure /// Closure with custom arguments and return value, may throw an error. public typealias ThrowableClosure = (Input) throws -> Output From d9f7da35f1adf36a1fbbca397601f0287f8c5f5e Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 19 Mar 2019 16:05:57 +0500 Subject: [PATCH 7/7] Added missing function --- CHANGELOG.md | 1 + .../Views/BasePlaceholderView/BasePlaceholerView.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f3e9f91..fb7ec37b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 0.9.11 - **[Breaking change]**: Renamed `NumberFormat`'s `allOptions` to `allCases` - **Fix**: Closure syntax fix. New closure naming. +- **Fix**: Added missing `BasePlaceholderView` protocol function. ### 0.9.10 - **Remove**: Removed unused scheme & target diff --git a/Sources/Classes/Views/BasePlaceholderView/BasePlaceholerView.swift b/Sources/Classes/Views/BasePlaceholderView/BasePlaceholerView.swift index 479b9ce2..3e5e77d9 100644 --- a/Sources/Classes/Views/BasePlaceholderView/BasePlaceholerView.swift +++ b/Sources/Classes/Views/BasePlaceholderView/BasePlaceholerView.swift @@ -75,6 +75,10 @@ open class BasePlaceholderView: UIView, InitializableView { open func localize() { // override in subclass } + + open func configureLayout() { + // override in subclass + } } public extension BasePlaceholderView {