Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxep/MXParallaxHeader
Simple parallax header for UIScrollView
https://github.com/maxep/MXParallaxHeader
Last synced: 7 days ago
JSON representation
Simple parallax header for UIScrollView
- Host: GitHub
- URL: https://github.com/maxep/MXParallaxHeader
- Owner: maxep
- License: mit
- Created: 2015-10-28T17:13:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T02:56:31.000Z (about 3 years ago)
- Last Synced: 2024-05-16T00:24:14.587Z (6 months ago)
- Language: Objective-C
- Size: 13.8 MB
- Stars: 1,728
- Watchers: 28
- Forks: 250
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - MXParallaxHeader - Simple parallax header for UIScrollView. (Libs / UI)
- awesome-swift - MXParallaxHeader - Simple parallax header for UIScrollView. (Libs / UI)
- awesome-cocoa - MXParallaxHeader
- awesome-swift - MXParallaxHeader - Simple parallax header for UIScrollView ` 📝 5 months ago ` (UI [🔝](#readme))
- awesome-swift - MXParallaxHeader - Simple parallax header for UIScrollView. (Libs / UI)
README
# MXParallaxHeader
[![CI Status](http://img.shields.io/travis/maxep/MXParallaxHeader.svg?style=flat)](https://travis-ci.org/maxep/MXParallaxHeader)
[![Version](https://img.shields.io/cocoapods/v/MXParallaxHeader.svg?style=flat)](http://cocoapods.org/pods/MXParallaxHeader)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/MXParallaxHeader.svg?style=flat)](http://cocoapods.org/pods/MXParallaxHeader)
[![Platform](https://img.shields.io/cocoapods/p/MXParallaxHeader.svg?style=flat)](http://cocoapods.org/pods/MXParallaxHeader):warning: This project is no longer maintained, see [#124](https://github.com/maxep/MXParallaxHeader/issues/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](Example/demo1.gif)|![Demo](Example/demo2.gif)|## Usage
If you want to try it, simply run:
```
pod try MXParallaxHeader
```+ Adding a parallax header to a UIScrollView is straightforward, e.g:
Swift
```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
```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;
```+ The MXScrollViewController is a container with a child view controller that can be added programmatically or using the custom segue MXScrollViewControllerSegue.
+ Please check examples for **Swift** implementations.
## 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/mexp/MXParallaxHeader", .upToNextMajor(from: "1.1.0"))
]
```### CocoaPods
MXParallaxHeader is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "MXParallaxHeader"
```## Documentation
Documentation is available through [CocoaDocs](http://cocoadocs.org/docsets/MXParallaxHeader/).
## Author
[Maxime Epain](http://maxep.github.io)
[![Twitter](https://img.shields.io/badge/twitter-%40MaximeEpain-blue.svg?style=flat)](https://twitter.com/MaximeEpain)
## License
MXParallaxHeader is available under the MIT license. See the LICENSE file for more info.