Need help with IOStickyHeader?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

BenjaminPrieur
199 Stars 25 Forks MIT License 41 Commits 6 Opened issues

Description

Parallax and Sticky header done right using UICollectionViewLayout

Services available

!
?

Need anything else?

Contributors list

# 182,354
Go
redis-c...
Redis
redis-c...
15 commits
# 546,418
Swift
Objecti...
5 commits
# 163,564
closure
CSS
Objecti...
React N...
1 commit
# 705,689
Swift
Objecti...
1 commit
# 242,006
Swift
Objecti...
1 commit

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.