Skip to content

Commit

Permalink
issue-860: Updated TabBar color states and added an independent line …
Browse files Browse the repository at this point in the history
…color state.
  • Loading branch information
Daniel Dahan committed Oct 19, 2017
2 parents 03a4e9f + 3df7636 commit a6f0225
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/iOS/TabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,15 @@ open class TabBar: Bar {
fileprivate let line = UIView()

/// A value for the line alignment.
@objc
open var lineAlignment = TabBarLineAlignment.bottom {
didSet {
layoutSubviews()
}
}

/// The line height.
@objc
open var lineHeight: CGFloat {
get {
return line.bounds.height
Expand Down Expand Up @@ -440,6 +442,7 @@ extension TabBar {
- Parameter at index: An Int.
- Paramater completion: An optional completion block.
*/
@objc
open func select(at index: Int, completion: ((TabItem) -> Void)? = nil) {
guard -1 < index, index < tabItems.count else {
return
Expand Down Expand Up @@ -491,7 +494,10 @@ fileprivate extension TabBar {
v.setTitleColor(normalColor, for: .normal)
v.setTitleColor(selectedColor, for: .selected)
v.setTitleColor(highlightedColor, for: .highlighted)
v.tintColor = normalColor
}

selectedTabItem?.tintColor = selectedColor
}

/// Updates the line colors.
Expand Down

0 comments on commit a6f0225

Please sign in to comment.