• Stars
    star
    199
  • Rank 194,959 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 12 years ago
  • Updated over 10 years ago

Reviews

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

Repository Details

Parallax ViewController made specifically for showcasing multiple images

GKLParallaxPictures

This component allows you to display an image gallery on top of a simple UIView or UIWebView. Scroll and you will see a nice parallax effect.

Install

The easiest way to install this component is via CocoaPods.

Add the following line to your podfile:

pod 'GKLParallaxPictures'

Then run the pod install command and import GKLParallaxPicturesViewController.h where you plan to use this.

You can also install it manually. Just drag GKLParallaxPicturesViewController.h and GKLParallaxPicturesViewController.m in your project and import the .h file where you want to use this component.

How To Use

GKLParallaxPicturesViewController *paralaxViewController = [[GKLParallaxPicturesViewController alloc] initWithImages:imagesArray andContentView:contentView];

Where contentView is the detailed view you want below your images.

You can always add more images after the view controller is instantiated by calling:

[paralaxViewController addImages:moreImagesArray];

Image arrays can contain both istances of UIImage and NSString. In the latter case those will be URLs of those images which will be loaded asynchronously.

Displaying a web view

This is the reason I forked for. It was not possible to display an UIWebView as the contentView.

UIWebView *testWebView = [[UIWebView alloc] init];
[testWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://nshipster.com/"]]];

UIImage *testImage = [UIImage imageNamed:@"shovel"];
NSArray *images = @[testImage, testImage, testImage];

GKLParallaxPicturesViewController *paralaxViewController = [[GKLParallaxPicturesViewController alloc] initWithImages:images
                                                                                                      andContentWebView:testWebView];

Result:

URL Image Loading

GKLParallaxPictures accepts both UIImages and NSStrings (of an image URL) for adding UIImageViews into the top gallery. By default it uses dispatch_queue to load images asynchronously, but you can subclass GKLParallaxPictures and overwrite this method to handle image loading however you choose.

Default image loading:

-(void)loadImageFromURLString:(NSString*)urlString forImageView:(UIImageView*)imageView{
	dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
	dispatch_async(queue, ^{
    	NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:urlString]];
    	dispatch_sync(dispatch_get_main_queue(), ^{
        	UIImage *downloadedImage = [[UIImage alloc] initWithData:imageData];
        	[imageView setImage:downloadedImage];
    	});
	});
}

More Repositories

1

ParallaxBlur

Easy to subclass parallax UITableController w/ blurring image header, floating header, and UIScrollView for content
Objective-C
818
star
2

SouthwestCheckin

🛫 Python script to checkin to a Southwest Flight 🛬
Python
424
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