https://github.com/ngochiencse/HPParallaxHeader
Simple parallax header for UIScrollView.
https://github.com/ngochiencse/HPParallaxHeader
Last synced: 20 days ago
JSON representation
Simple parallax header for UIScrollView.
- Host: GitHub
- URL: https://github.com/ngochiencse/HPParallaxHeader
- Owner: ngochiencse
- License: mit
- Created: 2021-03-04T15:36:32.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T11:21:30.000Z (9 months ago)
- Last Synced: 2025-03-02T01:01:57.501Z (about 1 month ago)
- Language: Swift
- Size: 8.13 MB
- Stars: 57
- Watchers: 3
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - HPParallaxHeader - Simple parallax header for UIScrollView. (Libs / UI)
- awesome-swift - HPParallaxHeader - Simple parallax header for UIScrollView. (Libs / UI)
README
# HPParallaxHeader
[](https://www.travis-ci.com/github/ngochiencse/HPParallaxHeader)
[](http://cocoapods.org/pods/HPParallaxHeader)
[](https://swiftpackageindex.com/ngochiencse/HPParallaxHeader)
[](https://github.com/Carthage/Carthage)
[](http://cocoapods.org/pods/HPParallaxHeader)
[](http://cocoapods.org/pods/HPParallaxHeader)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 |
|---------------------------------|-------------------------------------------|
|||## Usage
If you want to try it, simply run:
```
pod try HPParallaxHeader
```+ Adding a parallax header to a UIScrollView is straightforward, e.g:
```swift
let headerView = UIImageView()
headerView.image = UIImage(named: "success-baby")
headerView.contentMode = .scaleAspectFitlet 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](https://swift.org/package-manager/) directly within Xcode or add it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/ngochiencse/HPParallaxHeader", .upToNextMajor(from: "1.1.8"))
]
```### CocoaPods
HPParallaxHeader is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
```ruby
pod "HPParallaxHeader"
```## Documentation
Documentation is available through [GitHub](https://ngochiencse.github.io/HPParallaxHeader/documentation/hpparallaxheader).
## Author
[Hien Pham](https://github.com/ngochiencse)

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