Code Monkey home page Code Monkey logo

hpparallaxheader's Introduction

HPParallaxHeader

Travis (.com) Version Swift 5.4 Carthage compatible License Cocoapods platforms

HPParallaxHeader is a Swift conversion from https://github.com/maxep/MXParallaxHeader.

HPParallaxHeader is a simple header class for UIScrollView.

In addition, HPScrollView 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, HPScrollViewController allows you to add a HPParallaxHeader to any kind of UIViewController.

UIScrollView HPScrollViewController
Demo Demo

Usage

If you want to try it, simply run:

pod try HPParallaxHeader
  • Adding a parallax header to a UIScrollView is straightforward, e.g:
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
  • The HPScrollViewController is a container with a child view controller that can be added programmatically or using the custom segue HPScrollViewControllerSegue.

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/ngochiencse/HPParallaxHeader", .upToNextMajor(from: "1.1.6"))
]

CocoaPods

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

pod "HPParallaxHeader"

Documentation

Documentation is available through CocoaDocs.

Author

Hien Pham

Twitter URL

License

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

hpparallaxheader's People

Contributors

bsv-hienpham1991 avatar ngochiencse avatar omartawashi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.