PagingFlowView 0.1.0

PagingFlowView 0.1.0

测试已测试
语言语言 SwiftSwift
许可协议 MIT
发布最后发布2017年8月
SwiftSwift 版本3.0
SPM支持 SPM

Qinghua Hong 维护。



  • 作者:
  • xohozu

PagingFlowView

演示

Demo Out-of-Box PagingFlowLayout

示例代码

override func viewDidLoad() {
    super.viewDidLoad()

    // begin to create cusmizable paging flow layout

    let pagingFlowLayout = PagingFlowLayout()

    pagingFlowLayout.pageRange = 145
    pagingFlowLayout.minimumSkippingPages = 1
    pagingFlowLayout.maximumSkippingPages = 1
    // pagingFlowLayout.pagingAlignOffset = CGPoint(x: -10, y: 0)
    // pagingFlowLayout.initiateCompensativeAnimationOnEndDraggingPage = true

    // that's done

    // below lines code is common configuration

    pagingFlowLayout.itemSize = CGSize(width: 140, height: 210)
    pagingFlowLayout.minimumLineSpacing = 5
    pagingFlowLayout.minimumInteritemSpacing = 5
    pagingFlowLayout.scrollDirection = .horizontal

    collectionView = UICollectionView(frame: CGRect(origin: .zero, size: CGSize(width: view.bounds.width, height: 210)), collectionViewLayout: pagingFlowLayout)

    collectionView.center = view.center
    collectionView.dataSource = self
    collectionView.delegate = self
    collectionView.contentInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
    collectionView.register(InstagramUserRecommendationCell.self, forCellWithReuseIdentifier: "InstagramUserRecommendationCell")
    collectionView.backgroundColor = UIColor(red: 250.0 / 255, green: 250.0 / 255, blue: 250.0 / 255, alpha: 1.0)

    view.addSubview(collectionView)
    view.backgroundColor = .white

    automaticallyAdjustsScrollViewInsets = false
}

示例

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install

要求

安装

PagingFlowView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile

pod "PagingFlowView"

作者

xohozu, [email protected]

许可协议

PagingFlowView 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。