CollectionPageboy 1.0.4

CollectionPageboy 1.0.4

Maintained by janlionly.



  • By
  • janlionly

CollectionPageboy

Version License Platform Swift

CollectionPageboy demo image

Description

CollectionPageboy is a collection view controller which support to customize your xib''s cell, and support scrolling vertical or horizontal.

Installation

CocoaPods

pod 'CollectionPageboy'

Usage

// in some controller:
let boy = CollectionPageboy<String>()
boy.items = ["a", "b","c", "d","e", "f","g", "h"]
boy.collectionHeight = 290
boy.collectionBGColor = .blue
boy.customCollectionCellNibName = "MyCustomCell"
boy.cellIdentifier = "MyCustomCell"
boy.style = .vertical
boy.rowCount = 4
boy.columnCount = 4
boy.present(based: self)

// then customize your collection view cell with xib
class MyCustomCell: PageboyCustomCollectionCell {
    @IBOutlet weak var label: UILabel!
    @IBOutlet weak var imageView: UIImageView!
    
    override open func setup(_ item: Any) {
        backgroundColor = UIColor.red.withAlphaComponent(0.15)
        if let str = item as? String {
            label.text = str
        }
    }
}
// more usages please download to see the sources demo.

Requirements

  • iOS 9.0+
  • Swift 4.2 to 5.1

Author

Visit my github: janlionly
Contact with me by email: [email protected]

Contribute

I would love you to contribute to CollectionPageboy

License

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