CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Mar 2017 |
| SwiftSwift Version | 3.0 |
| SPMSupports SPM | ✗ |
Maintained by Ryo Ishikawa.
Example of using in ViewController.
let layout = FlexibleCollectionViewLayout()
// The number of rows
layout.rows = 4
// The space between items
layout.spacing = 15
// Animation duration
layout.duration = 0.4
layout.sectionInset = UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15)
collectionView = FlexibleCollectionView(frame: UIScreen.main.bounds, layout: layout)
collectionView.delegate = self
collectionView.dataSource = self
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "CELL")
view.addSubview(collectionView)
FlexibleCollectionViewLayout is inherited from UICollectionViewFlowLayout. and these properties are available.
| Property name | Description |
|---|---|
| rows | The number of row |
| maximumRows | The maximum row count |
| minimumRows | The minimum row count |
| spacing | The space between items |
| duration | Animation duration |
| animationEnabled | animation flag |
FlexibleCollectionView can use the following delegate.
@objc public protocol FlexibleCollectionViewDelegate: UICollectionViewDelegate {
@objc optional func flexibleCollectionView(_ collectionView: FlexibleCollectionView, willSwipeViewFor direction: UISwipeGestureRecognizerDirection)
@objc optional func flexibleCollectionView(_ collectionView: FlexibleCollectionView, didSwipeViewFor direction: UISwipeGestureRecognizerDirection)
@objc optional func flexibleCollectionView(_ collectionView: FlexibleCollectionView, didFinishAnimation: Bool)
}
XCode8+
Swift3
pod "FlexibleCollectionView"and
$ pod install
Ryo Ishikawa, [email protected]
FlexibleCollectionView is available under the MIT license. See the LICENSE file for more info.