Add a method

This commit is contained in:
Iurii 2019-01-27 07:27:10 +03:00
parent 15ed08d7cf
commit 9517e1151e
3 changed files with 22 additions and 4 deletions

View File

@ -1,4 +1,8 @@
# Changelog
### 0.9.6
- **Add**: Add new `configureSeparators` method to `SeparatorRowBox` array.
### 0.9.5
- **Add**: `TitleType` enum, that defines `UIViewController`'s title type.
- **Add**: `UINavigationItem.largeTitleDisplayMode` property, that defines `UINavigationItem`'s large title display mode.

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LeadKit"
s.version = "0.9.5"
s.version = "0.9.6"
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

@ -35,17 +35,31 @@ public extension Array where Element == SeparatorRowBox {
func configureSeparators(extreme extremeSeparatorConfiguration: SeparatorConfiguration,
middle middleSeparatorConfiguration: SeparatorConfiguration) {
configureSeparators(first: extremeSeparatorConfiguration,
middle: middleSeparatorConfiguration,
last: extremeSeparatorConfiguration)
}
/// Configure separators from SeparatorRowBox array
/// - parameter top: Configuration of the top separator of the first row
/// - parameter middle: Configuration of the separators between the rows
/// - parameter bottom: Configuration of the bottom separator of the last row
func configureSeparators(first topSeparatorConfiguration: SeparatorConfiguration,
middle middleSeparatorConfiguration: SeparatorConfiguration,
last bottomSeparatorConfiguration: SeparatorConfiguration) {
if isEmpty {
return
}
switch count {
case 1:
first?.set(separatorType: .full(extremeSeparatorConfiguration, extremeSeparatorConfiguration))
first?.set(separatorType: .full(topSeparatorConfiguration, bottomSeparatorConfiguration))
default:
forEach { $0.set(separatorType: .bottom(middleSeparatorConfiguration)) }
first?.set(separatorType: .full(extremeSeparatorConfiguration, middleSeparatorConfiguration))
last?.set(separatorType: .bottom(extremeSeparatorConfiguration))
first?.set(separatorType: .full(topSeparatorConfiguration, middleSeparatorConfiguration))
last?.set(separatorType: .bottom(bottomSeparatorConfiguration))
}
}