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 bottomSeparatorView: SeparatorView?
public enum SeparatorFrequency: String {
case All = "all"
case AllExceptTop = "allExceptTop"
case AllExceptBottom = "allExceptBottom"
case Between = "between"
case all
case allExceptTop
case allExceptBottom
case between
}
/// For subclasses that want to use a custom accessory view.
@ -256,7 +256,7 @@ import UIKit
} else {
topSeparatorView?.hide()
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.
public func setSeparatorFrequency(_ separatorFrequency: SeparatorFrequency, indexPath: IndexPath) {
switch separatorFrequency {
case .All:
case .all:
if indexPath.row == 0 {
topSeparatorView?.show()
} else {
topSeparatorView?.hide()
}
bottomSeparatorView?.show()
case .AllExceptBottom:
case .allExceptBottom:
topSeparatorView?.show()
bottomSeparatorView?.hide()
case .Between:
case .between:
if indexPath.row == 0 {
topSeparatorView?.hide()
} else {
topSeparatorView?.show()
}
bottomSeparatorView?.hide()
case .AllExceptTop:
case .allExceptTop:
fallthrough
default:
topSeparatorView?.hide()