项目介绍:
https://github.com/IvanVorobei/SegmentedControl
About
Custom SegmentedСontrol for ios on swift. Basic UISegmentedСontrol edit not weak and does not use the scroll, which will be added in this control
自定义SegmentedСontrol ios on swift。增强UISegmentedСontrol的编辑能力和滚动能力。
How use
Create cell:
let cell = SPSegmentedControlCell.init()
cell.label.text = "Avenir"
cell.imageView.image = UIImage.init(named: "imageName")
cell.layout = .textWithImage
Create SegmentedСontrol:
let segmentedСontrol = SPSegmentedControl.init()
segmentedСontrol.add(cell: cell)
and set frame, add as subview
Delegates
SPSegmentedControlCellStyleDelegate use for update state cell when it happen (tap on cell or scroll optional). SPSegmentedControlDelegate you can use for detect position IndicatorView in SegmentedControl for cool animation and UI
SPSegmentedControlCellStyleDelegate用于更新状态单元时发生(点击单元格或滚动)。 SPSegmentedControlDelegate你可以使用在SegmentedControl的检测位置IndicatorView的动画和UI