SGPagingView 2.1.0

SGPagingView 2.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2021年12月

kingsic 维护。



  • 作者:
  • kingsic

SGPagingView

前言

  • QQ群:825339547
  • 从 2.0.0 版本开始,升级为 Swift 编程语言
  • Obj-C 版本说明

结构图

效果图

安装

  • 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)
}

需求

  • iOS 10.0+
  • Swift 5.0+

结论