Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kingsic/SGPagingView
A powerful and easy to use segment view 【QQ、淘宝、微博、腾讯、网易新闻、今日头条等标题滚动视图】
https://github.com/kingsic/SGPagingView
pagingview swift
Last synced: 11 days ago
JSON representation
A powerful and easy to use segment view 【QQ、淘宝、微博、腾讯、网易新闻、今日头条等标题滚动视图】
- Host: GitHub
- URL: https://github.com/kingsic/SGPagingView
- Owner: kingsic
- License: mit
- Created: 2016-10-05T22:15:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-17T17:16:46.000Z (almost 3 years ago)
- Last Synced: 2024-05-18T16:01:23.881Z (6 months ago)
- Topics: pagingview, swift
- Language: Swift
- Homepage:
- Size: 22.8 MB
- Stars: 1,578
- Watchers: 30
- Forks: 287
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - SGPagingView
- Awesome-iOS - SGPagingView - A powerful and easy to use segment control 【QQ、淘宝、微博、腾讯、网易新闻、今日头条等标题滚动视图】 (UI Components)
README
# SGPagingView
## 前言
* QQ群:825339547
* 2.0.0 版本起,升级为 Swift 编程语言
* [Objc 版本说明](https://github.com/kingsic/SGPagingView/blob/master/READMEOBJC.md)## 结构图
![](https://github.com/kingsic/SGPagingView/blob/master/Pictures/SGPagingView.png)## 效果图
![](https://github.com/kingsic/Kar98k/blob/master/SGPagingView/SGPagingView.gif)## Installation
* CocoaPods 导入 pod 'SGPagingView', '~> 2.1.0'## 代码介绍
* 初始化方法
```
// 配置类
let configure = SGPagingTitleViewConfigure()// 标题视图
let pagingTitleView = SGPagingTitleView(frame: frame, titles: titles, configure: configure)
pagingTitleView.delegate = self
view.addSubview(pagingTitleView)// 内容视图
let pagingContentView = SGPagingContentScrollView(frame: frame, parentVC: self, childVCs: childVCs)
pagingContentView.delegate = self
view.addSubview(pagingContentView)
```* SGPagingTitleView 代理方法
```
func pagingTitleView(titleView: SGPagingTitleView, index: Int) {
pagingContentView.setPagingContentView(index: index)
}
```* SGPagingContentView 代理方法
```
func pagingContentView(contentView: SGPagingContentView, progress: CGFloat, currentIndex: Int, targetIndex: Int) {
pagingTitleView.setPagingTitleView(progress: progress, currentIndex: currentIndex, targetIndex: targetIndex)
}
```## Requirements
* iOS 10.0 +
* Swift 5.0 +## Concluding remarks
* 如有问题 [issues](https://github.com/kingsic/SGPagingView/issues)