maxep / MXParallaxHeader

Simple parallax header for UIScrollView
MIT License
1.73k stars 251 forks source link

MXParallaxHeader

CI Status Version Carthage compatible License Platform

:warning: This project is no longer maintained, see #124 :warning:

MXParallaxHeader is a simple header class for UIScrollView.

In addition, MXScrollView is a UIScrollView subclass with the ability to hook the vertical scroll from its subviews, this can be used to add a parallax header to complex view hierachy. Moreover, MXScrollViewController allows you to add a MXParallaxHeader to any kind of UIViewController.

UIScrollView MXScrollViewController
Demo Demo

Usage

If you want to try it, simply run:

pod try MXParallaxHeader
Swift ```swift let headerView = UIImageView() headerView.image = UIImage(named: "success-baby") headerView.contentMode = .scaleAspectFit let scrollView = UIScrollView() scrollView.parallaxHeader.view = headerView scrollView.parallaxHeader.height = 150 scrollView.parallaxHeader.mode = .fill scrollView.parallaxHeader.minimumHeight = 20 ```
Objective-C ```objective-c UIImageView *headerView = [UIImageView new]; headerView.image = [UIImage imageNamed:@"success-baby"]; headerView.contentMode = UIViewContentModeScaleAspectFill; UIScrollView *scrollView = [UIScrollView new]; scrollView.parallaxHeader.view = headerView; scrollView.parallaxHeader.height = 150; scrollView.parallaxHeader.mode = MXParallaxHeaderModeFill; scrollView.parallaxHeader.minimumHeight = 20; ```

Installation

Swift Package Manager

You can use Swift Package Manager directly within Xcode or add it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/mexp/MXParallaxHeader", .upToNextMajor(from: "1.1.0"))
]

CocoaPods

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

pod "MXParallaxHeader"

Documentation

Documentation is available through CocoaDocs.

Author

Maxime Epain

Twitter

License

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