HPParallaxHeader is a simple parallax header class for UIScrollView.

Overview

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.

  • Please check examples for Swift implementations.

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.

Comments
  • [Request] Header background color option

    [Request] Header background color option

    final class MyContainerViewController: HPScrollViewController {    
        override var preferredStatusBarStyle : UIStatusBarStyle {
            return UIStatusBarStyle.lightContent
        }
    
    
        override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
    
            if #available(iOS 13.0, *) {
                let appearance = UINavigationBarAppearance()
                appearance.configureWithTransparentBackground()
                appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
                appearance.backgroundColor = UIColor(red: 0.0/255.0, green: 123.0/255.0, blue: 187.0/255.0, alpha: 1.0)
             
                navigationController?.navigationBar.scrollEdgeAppearance = appearance
                navigationController?.navigationBar.standardAppearance = appearance
            }
        }
    

    it can't mack white header under clock. Or I want the option for it.

    opened by sugitatestblue 3
  • [Feature] I want to access scrollView or contentOffset

    [Feature] I want to access scrollView or contentOffset

    It can't access scrollView

    extension HeaderViewController: HPParallaxHeaderDelegate {
        func parallaxHeaderDidScroll(_ parallaxHeader: HPParallaxHeader) {
            // can't access scrollView
            if let scrollView = parallaxHeader.scrollView {
                trackingOffset(scrollView)
            }
    }
    
    'scrollView' is inaccessible due to 'internal' protection level
    
    opened by sugitatestblue 1
  • ParallaxHeaderMode(bottom) Layout Issue

    ParallaxHeaderMode(bottom) Layout Issue

    Hi,

    Thanks for changing MXParallaxHeader to Swift.

    I found a problem with ParallaxHeaderMode (bottom).

    • HPParallaxHeader
    스크린샷 2021-07-02 오후 1 59 48
    • MXParallaxHeader
    스크린샷 2021-07-02 오후 2 00 07

    HPParallaxHeader is a topAnchor, but MXParallaxHeader is a bottomAnchor.

    I hope this will be a quick fix.

    bug 
    opened by DevChAe 1
  • [BUG] delegate parallaxHeaderDidScroll is called before scrolling

    [BUG] delegate parallaxHeaderDidScroll is called before scrolling

    parallaxHeaderDidScroll method return strange values even before my scrolling.(when initialized?)

    func parallaxHeaderDidScroll(_ parallaxHeader: HPParallaxHeader) {
        var progress = parallaxHeader.progress
        print(progress)
    }
    

    In the first loaded view controller.

    it logged 1, 0 before scrolling.

    opened by sugitatestblue 6
  • Swift Package Manger Issue

    Swift Package Manger Issue

    When installing it shows an error:

    because HPParallaxHeader >=1.1.5 contains incompatible tools version and root depends on HPParallaxHeader 1.1.7..<2.0.0, version solving failed

    Any tip to resolve this?

    Screen Shot 2022-03-04 at 14 16 57
    opened by EDMODJ 2
Owner
null
ScrollingFollowView is a simple view which follows UIScrollView scrolling.

ScrollingFollowView ScrollingFollowView is a simple view which follows UIScrollView scrolling. ScrollingFollowView Sample Images SearchBarSample : Sea

Tanaka Kenji 186 Dec 21, 2022
A scroll view with a sticky header which shrinks as you scroll. Written with SwiftUI.

Scaling Header Scroll View A scroll view with a sticky header which shrinks as you scroll. Written with SwiftUI. We are a development agency building

Exyte 395 Dec 31, 2022
UIScrollView ∞ scroll category

UIScrollView+InfiniteScroll Infinite scroll implementation as a category for UIScrollView. * The content used in demo app is publicly available and pr

Andrej Mihajlov 1k Dec 29, 2022
GoAutoSlideView extends UIScrollView by featuring infinitely and automatically slide.

GoAutoSlideView GoAutoSlideView extends UIScrollView by featuring infinitely and automatically slide. #ScreenShot Installation ###CocoaPods pod 'GoAut

Jamie 57 Jan 12, 2021
Multi-tier UIScrollView nested scrolling solution. 😋😋😋

Multi-tier UIScrollView nested scrolling solution. Snapshots Requirements iOS 9.0+ Xcode 10.0+ Swift 4.2+ Installation CocoaPods CocoaPods is a depend

Jiar 1.2k Dec 30, 2022
A data-driven UIScrollView + UIStackView framework for building fast and flexible lists

JKListKit A data-driven UIScrollView + UIStackView framework for building fast and flexible lists. Full Oficial documentation Main Features ?? Create

Juan Vasquez 2 Mar 15, 2022
AutoKeyboardScrollView is an UIScrollView subclass which makes showing and dismissing keyboard for UITextFields much easier. So called keyboard avoidance.

AutoKeyboardScrollView AutoKeyboardScrollView is a smart UIScrollView which can: Scroll to proper position and make sure the active textField is visib

HongHao Zhang 120 Jul 31, 2022
Simple parallax header for UIScrollView

MXParallaxHeader ⚠️ This project is no longer maintained, see #124 ⚠️ MXParallaxHeader is a simple header class for UIScrollView. In addition, MXScrol

Maxime Epain 1.7k Dec 9, 2022
Simple way to add parallax header to UIScrollView/UITableView written in Swift.

ParallaxHeader Simple way to add parallax header to UIScrollView or it's subclasses. One image view Slider with images Blur vibrant text Blur round ic

Roman Sorochak 998 Dec 11, 2022
UICollectionView replacement of UITableView. Do even more like Parallax Header, Sticky Section Header. Made for iOS 7.

CSStickyHeaderFlowLayout Contributors For anyone who'd like to be a contributor to the repository, please read the Contribution Guideline Parallax, St

null 5.1k Jan 6, 2023
Xcode Plugin helps you find missing methods in your class header, protocols, and super class, also makes fast inserting.

FastStub-Xcode Life is short, why waste it on meaningless typing? What is it? A code generating feature borrowed from Android Studio. FastStub automat

mrpeak 509 Jun 29, 2022
ScrollView that supports a parallax header image and static overlay.

ScrollViewReactiveHeader A replacement ScrollView that provides a header with subtle scroll animations. example-video.mov Using ScrollViewReactiveHead

null 49 Dec 29, 2022
A SwiftUI ScrollView Designed to imitate the App Store and Apple Music ScrollViews (with or without a Parallax Header)

FancyScrollView I spent a lot of time looking for a way to recreate the UI of the ScrollViews in Stock Apple Apps (i.e. App Store and Apple Music) ins

Mathias Quintero 696 Dec 30, 2022
Parallax scrolling effect on UITableView header view when a tableView is scrolled

ParallaxTableViewHeader Parallax scrolling effect on UITableView header view when a tableView is scrolled Usage Create a ParallaxHeaderView using eith

Vinodh Swamy 1.3k Nov 27, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
A simple class that wraps the process of saving or loading a struct or class into a single file

EZFile This is a simple class that wraps the process of saving or loading a stru

null 7 May 16, 2022
A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.

MJExtension A fast, convenient and nonintrusive conversion framework between JSON and model. 转换速度快、使用简单方便的字典转模型框架 ?? ✍??Release Notes: more details Co

M了个J 8.5k Jan 3, 2023
Apple TV Parallax effect in Swift.

MPParallaxView Apple TV Parallax effect in Swift. Rotate view using touch or accelerometer. Usage To run the example project, clone the repo, and run

Droids On Roids 1.7k Jan 4, 2023
tvOS controls and extensions that add parallax effect to your application.

ParallaxView Summary Easy to use UIView, UICollectionViewCell with parallax effect and extensions to add this effect to any UIView. Rotate view using

PGS Software 466 Nov 13, 2022
iOS 7/8 style side menu with parallax effect.

RESideMenu iOS 7/8 style side menu with parallax effect inspired by Dribbble shots (first and second). Since version 4.0 you can add menu view control

Roman Efimov 7.2k Dec 28, 2022