Latest 0.1.2
Homepage https://github.com/rinov/FlexibleCollectionView
License MIT
Platforms ios 8.0
Authors

License

FlexibleCollectionView is a subclass of UICollectionView, and easy to implement devideable photo viewer like view.

Example

FlexibleCollectionView-left
FlexibleCollectionView-right

Usage

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.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)

}

Requirements

XCode8+

Swift3

Installation

pod "FlexibleCollectionView"

and

$ pod install

Author

Ryo Ishikawa, [email protected]

License

FlexibleCollectionView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "FlexibleCollectionView",
    "version": "0.1.2",
    "summary": "An elegant grid layout for UICollectionView.",
    "description": "FlexibleCollectionView can use grid layout without complex steps.nIt keeps beautiful layout flexibly.",
    "homepage": "https://github.com/rinov/FlexibleCollectionView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ryo Ishikawa": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rinov/FlexibleCollectionView.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "FlexibleCollectionView/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This