SCPageControl
描述
滚动页面控件,其移动与页面移动距离同步。
接下来更新待办事项
- 应用到其他设计。
屏幕快照
需求
* Swift 5.0
* XCode 10.2 (10E125)
* iOS 9.0 (Min SDK)
* Not Use Autolayout
安装
SCPageControl 通过 CocoaPods 提供。要安装它,请简单地在您的 Podfile 中添加以下行
//Swift 5.0
pod "SCPageControl"
//Swift 4.2
pod "SCPageControl", '-> 0.3.2'
//Swift 4.0
pod "SCPageControl", '-> 0.2.1'
//After
pod install
如何使用
import SCPageControl
public enum SCPageStyle: Int {
case SCNormal = 100
case SCJAMoveCircle // Design by Jardson Almeida
case SCJAFillCircle // Design by Jardson Almeida
case SCJAFlatBar // Design by Jardson Almeida
}
let sc = SCPageControlView()
override func viewDidLoad() {
super.viewDidLoad()
sc.frame = CGRect(x: 0, y: UIScreen.main.bounds.size.height-50, width: UIScreen.main.bounds.size.width, height: 50)
sc.scp_style = .SCNormal
sc.set_view(5, current: 0, current_color: .red, disable_color: nil)
/**
disable_color is dot background color that current not focus
*/
//ScPageControl.set_view(5, current: 0, current_color: .red, disable_color: .gray)
view.addSubview(sc)
}
//MARK: ScrollView Delegate
func scrollViewDidScroll(_ scrollView: UIScrollView) {
sc.scroll_did(scrollView)
}
作者
myoung
设计和帮助
SCJA series Design is "Jardson Almeida", e-mail is "[email protected]"
Algorithm Help
Jangbyeonghui to PeopleRoad
许可
SCPageControl 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。