diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e6c08b7..04206bf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/LeadKit.podspec b/LeadKit.podspec index d213fcff..de4cd854 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -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" diff --git a/Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift b/Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift index 690b26a0..dd01f313 100644 --- a/Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift +++ b/Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift @@ -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 first: Configuration of the top separator of the first row + /// - parameter middle: Configuration of the separators between the rows + /// - parameter last: Configuration of the bottom separator of the last row + func configureSeparators(first firstSeparatorConfiguration: SeparatorConfiguration, + middle middleSeparatorConfiguration: SeparatorConfiguration, + last lastSeparatorConfiguration: SeparatorConfiguration) { + if isEmpty { return } switch count { case 1: - first?.set(separatorType: .full(extremeSeparatorConfiguration, extremeSeparatorConfiguration)) + first?.set(separatorType: .full(firstSeparatorConfiguration, lastSeparatorConfiguration)) + default: forEach { $0.set(separatorType: .bottom(middleSeparatorConfiguration)) } - first?.set(separatorType: .full(extremeSeparatorConfiguration, middleSeparatorConfiguration)) - last?.set(separatorType: .bottom(extremeSeparatorConfiguration)) + first?.set(separatorType: .full(firstSeparatorConfiguration, middleSeparatorConfiguration)) + last?.set(separatorType: .bottom(lastSeparatorConfiguration)) } }