• Stars
    star
    818
  • Rank 55,733 (Top 2 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy to subclass parallax UITableController w/ blurring image header, floating header, and UIScrollView for content

ParallaxBlur

CI Status Version License Platform

ParallaxBlur aims the be an easy-to-use implementation of a UITableController with a parallax header. It is screen resolution independant, orientation indendant, and will automatically adjust if there is a navigation bar in place.

The user interaction is fairly straightforward. The header image blurs as you scroll up, leaving a 60 pixel area always visible, and expands out the header image if you pull down, while at the same time making the overlay views transparent.

Developed at Software for Good.

Inspiration was taken from Aaron Pang's SecretViewer. I liked the way it looked and behaved, but it wasn't extremely customizable, and not setup to be used as a Pod.

Basic Usage

Usage is pretty simple. Subclass JPBFloatingTextViewController and then customize it within viewDidLoad:

[self setHeaderImage:[UIImage imageNamed:@"meatballs.jpeg"]];
[self setTitleText:@"The Best Title in the World"];
[self setSubtitleText:@"ikea meatballs are the bomb"];

You should override the required UITableViewDatasource and UITableViewDelegate methods to supply the content section with cells and handle user selections.

Advanced Usage

You can also more heavily customize the header by using addHeaderOverlayView:. Using this will add the passed UIView to the scrolling header. An example can be seen in CustomHeaderViewController.m. You can get the height of the header (useful for getting things to align near the bottom) by calling [self headerHeight].

imageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, [self headerHeight] - 100, 90, 90)];
[imageView setImage:[UIImage imageNamed:@"awesome.jpg"]];
[self addHeaderOverlayView:imageView];

Loading Images Asynchronously

If you want to load remote images, I'd recommend using SDWebImage. Example for using it with ParallaxBlur:

[[SDWebImageManager sharedManager] downloadImageWithURL:headerImageURL options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) {
    //Track progress if you wish
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
    if (finished) {
      [self setHeaderImage:image];
    }
}];

Geeky Stuff

The view controller manages three UIScrollViews, one for the header/background, one for the lower content, and an "main" one to handle user interactions and delegate callbacks. The image "blurring" is just a gradual change in a secondary image overlay's alpha, which is a blurred version of the image set, precalculated and run through FXBlurView.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 7.0 or higher.

Installation

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

pod "ParallaxBlur"

Author

pyro2927, [email protected]

License

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

More Repositories

1

SouthwestCheckin

🛫 Python script to checkin to a Southwest Flight 🛬
Python
425
star
2

GKLParallaxPictures

Parallax ViewController made specifically for showcasing multiple images
Objective-C
199
star
3

GKLCubeViewController

Cube-ular view controller that can be rotated by a pan gesture
Objective-C
70
star
4

AWS_SSO_Containers

Firefox extension to route AWS SSO logins into unique containers.
JavaScript
59
star
5

JPStackedViewController

Allows multiple stacked view controllers to be slid around
Objective-C
23
star
6

GoogleDocsBackend

Use a Google Docs Spreadsheet in a style similar to Parse
Objective-C
20
star
7

idotjs

dotjs for iOS
Objective-C
16
star
8

Tweeter

Twitter Framework for the iPhone (or really any Obj-C project)
Objective-C
16
star
9

mediabox

Plex, Sickbeard, CouchPotato, Transmission, all setup on a single box using Ansible.
Shell
13
star
10

ParseQuickDialog

Simple app/library to view Parse classes and objects, leveraging the QuickDialog framework
Objective-C
9
star
11

reddit

open source reddit application
Objective-C
7
star
12

PlexCloud

Scripts to automatically set up a Plex cloud server.
Shell
7
star
13

tocify

Generate a markdown-formatted table of contents from an existing file
Ruby
5
star
14

GKLPhotoFetcher

Quick and easy way to get photos from iOS devices
Objective-C
5
star
15

ObjCtpl

Simple template engine for Objective-C
Objective-C
4
star
16

Pebble-Quick-Config

Quick/easy Pebble config page for use with the 2.0 SDK
Ruby
4
star
17

jpduckencoder

A branched version of duckencoder from Hak5
Java
3
star
18

PlexNewsletterGenerator

Code to generate & send a Plex newsletter
Ruby
3
star
19

BlaseIt

Stupid script to bet on my blaseball games for me
Python
2
star
20

TuringGameMakers

2
star
21

erin-cheet-sheets

2
star
22

DuckEncoder

App that allows you to prep injection bins for use with the USB Rubber Ducky
Java
2
star
23

Heroku-Faye-Node-RedisToGo

Easily get a pub-sub working with Faye on Heroku.
JavaScript
2
star
24

Komoboard

Open source geckoboard thingy. I have no clue what I'm doing....
Ruby
2
star
25

blitzcrank

Copy down remote files and sort them into local directories with ease.
Ruby
2
star
26

Backend-Comparison

Comparison of different backend services for iOS
Objective-C
2
star
27

City-Review

A markdown driven collection of information on places I've visited and lived
HTML
1
star
28

PlexNotifier

A Plex menu-bar app to notify you of new media or media plays
Swift
1
star
29

ImgurAPIKit

Imgur API SDK for iOS/OS X
Objective-C
1
star
30

Plexbeat

A Beat to track stats about your Plex server
Go
1
star
31

RickCast

Zero-configuration required Rickrolling via ChromeCast
Objective-C
1
star
32

iStatD-Ansible

Ansible script to install iStatD for Linux servers
1
star
33

ansible-tipboard

Ansible role for Tipboard
1
star
34

AdvancedWarsJS

Attempting to re-make Advanced Wars with HTML, CSS, and some Javascript
JavaScript
1
star