SGPageTitleViewConfigure(SGPageTitleView 初始化配置信息)
SGPageTitleView(用于与 SGPageContent 联动)
SGPageContentScrollView(内部由 UIScrollView 实现)
SGPageContentCollectionView(内部由 UICollectionView 实现)
- 下载、拖拽 “SGPagingViewSwift” 文件夹到工程中
// SGPageTitleViewConfigure
let configure = SGPageTitleViewConfigure()
// SGPageTitleView
self.pageTitleView = SGPageTitleView(frame: rect, delegate: self, titleNames: titles, configure: configure)
view.addSubview(pageTitleView!)
// SGPageContentScrollView
self.pageContentScrollView = SGPageContentScrollView(frame: contentRect, parentVC: self, childVCs: childVCs)
pageContentScrollView?.delegateScrollView = self
view.addSubview(pageContentScrollView!)
func pageTitleView(pageTitleView: SGPageTitleView, index: Int) {
pageContentScrollView?.setPageContentScrollView(index: index)
}
func pageContentScrollView(pageContentScrollView: SGPageContentScrollView, progress: CGFloat, originalIndex: Int, targetIndex: Int) {
pageTitleView?.setPageTitleView(progress: progress, originalIndex: originalIndex, targetIndex: targetIndex)
}
- iOS 8.0 +
- Xcode 9.4.1+
-
更多内容介绍请参考 OC版