ios

IOStickyHeader

Parallax and Sticky header done right using UICollectionViewLayout

Showing:

Popularity

Downloads/wk

0

GitHub Stars

199

Maintenance

Last Commit

2yrs ago

Contributors

7

Package

Dependencies

0

License

MIT

Categories

Readme

I migrated CSStickyHeaderFlowLayout library (Obj-C) to swift3.0

IOStickyHeader

CI Status Version License Platform

Parallax, Sticky Headers, Growing image heading, done right in one UICollectionViewLayout.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Don't forget to set your flow layout with IOStickyHeader in your storyboard

Register that nib file to your collection view controller in code:

import IOStickyHeader

  let headerNib = UINib(nibName: "IOGrowHeader", bundle: NSBundle.mainBundle())
  override func viewDidLoad() {
      super.viewDidLoad()
        
      self.collectionView.registerNib(self.headerNib, forSupplementaryViewOfKind: IOStickyHeaderParallaxHeader, withReuseIdentifier: "header")
  }

Implement func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView

func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
    switch kind {
    case IOStickyHeaderParallaxHeader:
        let cell = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "header", forIndexPath: indexPath) as! IOGrowHeader
        return cell
    default:
        assert(false, "Unexpected element kind")
    }
}

Requirements

  • Swift 4.2
  • iOS 9

Installation

CococaPods

IOStickyHeader is available through CocoaPods. To install it, simply add the following line to your Podfile:

use_frameworks!
pod "IOStickyHeader"

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate IOStickyHeader into your Xcode project using Carthage, specify it in your Cartfile:

github "BenjaminPrieur/IOStickyHeader"

Run carthage update to build the framework and drag the built IOStickyHeader.framework into your Xcode project.

Author

Benjamin Prieur

License

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100