Merge pull request #192 from TouchInstinct/fix/blocks

Fix/blocks
This commit is contained in:
Pavel Lukandiy 2019-03-19 16:23:00 +05:00 committed by GitHub
commit 29de30cd37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,10 @@
# Changelog
### 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
- **Remove**: Cocoapods deintegrated

View File

@ -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"

View File

@ -75,6 +75,10 @@ open class BasePlaceholderView: UIView, InitializableView {
open func localize() {
// override in subclass
}
open func configureLayout() {
// override in subclass
}
}
public extension BasePlaceholderView {

View File

@ -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 {

View File

@ -21,19 +21,19 @@
//
/// Closure with custom arguments and return value.
public typealias Block<Input, Output> = (Input) -> Output
public typealias Closure<Input, Output> = (Input) -> Output
/// Closure with no arguments and custom return value.
public typealias ResultBlock<Output> = Block<Void, Output>
public typealias ResultClosure<Output> = () -> Output
/// Closure that takes custom arguments and returns Void.
public typealias ParameterBlock<Input> = Block<Input, Void>
public typealias ParameterClosure<Input> = Closure<Input, Void>
/// Closure that takes no arguments and returns Void.
public typealias VoidBlock = ResultBlock<Void>
public typealias VoidBlock = ResultClosure<Void>
/// Closure with custom arguments and return value, may throw an error.
public typealias ThrowableBlock<Input, Output> = (Input) throws -> Output
public typealias ThrowableClosure<Input, Output> = (Input) throws -> Output
/// Closure that takes no arguments, may throw an error and returns Void.
public typealias ThrowableVoidBlock = () throws -> Void

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.9.10</string>
<string>0.9.11</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.9.10</string>
<string>0.9.11</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.9.10</string>
<string>0.9.11</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>

View File

@ -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 }