Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Parallax scrolling effect on UITableView header view when scrolled

Notifications You must be signed in to change notification settings

davrosull/ParallaxHeader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ParallaxHeader

Parallax scrolling effect on UITableView header view when scrolled, built using Swift.

Installation

Copy ParallaxHeader.swift into your project.

Usage

Create a reference to the ParallaxHeader class:

let parallaxHeader = ParallaxHeader()

In viewDidLoad() set the tableheader to the parallax header:

tableView.tableHeaderView = parallaxHeader.parallaxHeaderViewWithImage(UIImage(named: "HeaderBackground")!, headerSize: CGSizeMake(tableView.frame.size.height, 300))
parallaxHeader.layoutHeaderViewForScrollViewOffset(self.tableView.contentOffset)

Override the scrollViewDelegate method:

override func  scrollViewDidScroll(scrollView: UIScrollView) {
    parallaxHeader.layoutHeaderViewForScrollViewOffset(scrollView.contentOffset)
}

Credits

Heavily influenced on ParallaxTableViewHeader by Vinodh-G

About

Parallax scrolling effect on UITableView header view when scrolled

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages