enum clean

This commit is contained in:
Pfeil, Scott Robert 2019-10-29 13:47:49 -04:00
parent 7e810ec334
commit 59be22c0e0

View File

@ -24,10 +24,10 @@ import UIKit
public var topSeparatorView: SeparatorView? public var topSeparatorView: SeparatorView?
public var bottomSeparatorView: SeparatorView? public var bottomSeparatorView: SeparatorView?
public enum SeparatorFrequency: String { public enum SeparatorFrequency: String {
case All = "all" case all
case AllExceptTop = "allExceptTop" case allExceptTop
case AllExceptBottom = "allExceptBottom" case allExceptBottom
case Between = "between" case between
} }
/// For subclasses that want to use a custom accessory view. /// For subclasses that want to use a custom accessory view.
@ -256,7 +256,7 @@ import UIKit
} else { } else {
topSeparatorView?.hide() topSeparatorView?.hide()
bottomSeparatorView?.setAsLight() bottomSeparatorView?.setAsLight()
setSeparatorFrequency(TableViewCell.SeparatorFrequency.AllExceptTop, indexPath: indexPath) setSeparatorFrequency(TableViewCell.SeparatorFrequency.allExceptTop, indexPath: indexPath)
} }
} }
@ -285,24 +285,24 @@ import UIKit
/// For when the separator between cells shows. /// For when the separator between cells shows.
public func setSeparatorFrequency(_ separatorFrequency: SeparatorFrequency, indexPath: IndexPath) { public func setSeparatorFrequency(_ separatorFrequency: SeparatorFrequency, indexPath: IndexPath) {
switch separatorFrequency { switch separatorFrequency {
case .All: case .all:
if indexPath.row == 0 { if indexPath.row == 0 {
topSeparatorView?.show() topSeparatorView?.show()
} else { } else {
topSeparatorView?.hide() topSeparatorView?.hide()
} }
bottomSeparatorView?.show() bottomSeparatorView?.show()
case .AllExceptBottom: case .allExceptBottom:
topSeparatorView?.show() topSeparatorView?.show()
bottomSeparatorView?.hide() bottomSeparatorView?.hide()
case .Between: case .between:
if indexPath.row == 0 { if indexPath.row == 0 {
topSeparatorView?.hide() topSeparatorView?.hide()
} else { } else {
topSeparatorView?.show() topSeparatorView?.show()
} }
bottomSeparatorView?.hide() bottomSeparatorView?.hide()
case .AllExceptTop: case .allExceptTop:
fallthrough fallthrough
default: default:
topSeparatorView?.hide() topSeparatorView?.hide()