pod 'IndexBar'
- >= iOS 10.0
- >= Swift 5.0
let indexBar = IndexBar(frame: CGRect(x: view.bounds.width - 24, y: 0, width: 40, height: view.bounds.height))
indexBar.configure = { configure in
configure.sectionWH = 16
configure.titleFont = UIFont.systemFont(ofSize: 12)
configure.backgroundColorForSelected = UIColor.color(withHex: "#53ED7C")
}
indexBar.setData(sectionTitles, tableView: tableView)
view.addSubview(indexBar)
/// section normal title color
public var titleColor: UIColor = .lightGray
/// section title font
public var titleFont: UIFont = UIFont.systemFont(ofSize: 10)
/// section selected title color
public var titleColorForSelected: UIColor = .white
/// section selected background color
public var backgroundColorForSelected: UIColor = .blue
/// section width&height
public var sectionWH: CGFloat = 16
/// section vertical spacing
public var sectionSpacing: CGFloat = 4
/// show bubble view, default is true
public var showBubble = true
/// the configure of the bubble view
public var bubbleConfigure = BubbleConfigure()