• Stars
    star
    359
  • Rank 118,537 (Top 3 %)
  • Language
    Objective-C
  • License
    Other
  • Created almost 12 years ago
  • Updated over 11 years ago

Reviews

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

Repository Details

PaperFoldGallery for iOS

PaperFoldGallery

PaperFoldGallery displays multiple views in a paginated UIScrollView, but uses PaperFold library to animate to the next view.

PaperFoldGallery is used in the Walkthrough pages of Dispatch: Action-Based Email App.

How it works

The first level is a paginated UIScrollView that displays views in each page. The second level contains 2 PaperFold views that are folded/unfolded/hidden depending on the scroll view offset. These views show a folded screenshot of the views below it, and are hidden once the UIScrollView snaps to page.

The subviews can be any UIView subclasses, so it can be static view, or other views like UITableView.

The library takes a screenshot often to get the state of the view below it. If you are using static views, you can improve the unfolding performance by providing screenshots.

Usage

HCPaperFoldGalleryView

initWithFrame:folds:

Initialize the gallery view

- (id)initWithFrame:(CGRect)frame folds:(int)folds

Parameters

frame

This value specifies the size of the frame

folds

This value specifies number of folds

reloadData

Reloads content in the gallery view

- (void)reloadData

bouncesToHintNextPage

Bounces the view to the left slightly to show the next fold on the right

- (void)bouncesToHintNextPage

setPageNumber:animated:

Changes the current page

  • (void)setPageNumber:(int)pageNumber animated:(BOOL)animated

Parameters

pageNumber

This value specifies the page number to change to

animated

This value specifies whether the page change should be animated

setPageNumber:animated:completed:

- (void)setPageNumber:(int)pageNumber animated:(BOOL)animated completed:(void(^)())block

Parameters

pageNumber

This value specifies the page number to change to

animated

This value specifies whether the page change should be animated

block

This block is called when the animation is complete

HCPaperFoldGalleryViewDelegate

paperFoldGalleryView:viewAtPageNumber:

A non-optional method. Ask the delegate for cells at each page.

- (HCPaperFoldGalleryCellView*)paperFoldGalleryView:(HCPaperFoldGalleryView*)galleryView viewAtPageNumber:(int)pageNumber

Parameters

galleryView

The gallery view that requests for cell views

pageNumber

The page number requested

paperFoldGalleryView:didScrollToPageNumber:

Notifies the delegate when page changes

- (void)paperFoldGalleryView:(HCPaperFoldGalleryView *)galleryView didScrollToPageNumber:(int)pageNumber;

Parameters

galleryView

The gallery view where the page change happens

pageNumber

The page number of the new page after scrolling

HCPaperFoldGalleryViewDatasource

numbeOfItemsInPaperFoldGalleryView:

Requests dataSource for number if items to be displayed in the galleyView

- (NSInteger)numbeOfItemsInPaperFoldGalleryView:(HCPaperFoldGalleryView*)galleryView

Parameters

galleryView

The gallery view that will display the views

paperFoldGalleryView:imageAtPageNumber:

An optional method. Requests dataSource for UIImage to be displayed in the views' folds. If nil is returned, the library will take a screenshot automatically each time before folding. If a UIImage is returned, the library will use the image without taking screenshots (for better performance).

- (UIImage*)paperFoldGalleryView:(HCPaperFoldGalleryView*)galleryView imageAtPageNumber:(int)pageNumber

Parameters

galleryView

The gallery view that will display the views

pageNumber

The page number of the requested UIImage

Requirements

This project uses ARC. If you are not using ARC in your project, add '-fobjc-arc' as a compiler flag for all the files in this project. XCode 4.4 is required for auto-synthesis.

Contact

twitter.com/honcheng honcheng.com

More Repositories

1

PaperFold-for-iOS

Paper folding animation for iOS
Objective-C
2,700
star
2

RTLabel

simple rich text display for iOS using html-like markups
Objective-C
1,462
star
3

iOSPlot

Chart library for iOS
Objective-C
1,371
star
4

iOS-StyledPageControl

Customizable PageControl for iOS
Objective-C
526
star
5

PaperFoldMenuController

A navigation menu on the left of the screen using on PaperFold
Objective-C
436
star
6

CATransform3D-Test

A test app to visualize view transformation when value in CATransform3D matrices change
Objective-C
349
star
7

PanelTableView

Multiple UITableViews in a UIScrollView
Objective-C
202
star
8

StyledTableViewCell-for-iOS

Customize table view cell border and highlights
Objective-C
195
star
9

SliderPageControl-for-iOS

An alternative for UIPageControl
Objective-C
137
star
10

AcornCharts-for-iOS

Fun way to display charts using balls that responds to device tilting
Objective-C
113
star
11

ScrollableTabHost-for-Android

Java
90
star
12

iOS-nodechat

iOS chat client for socket.io & node.js backend
Objective-C
70
star
13

GAE-APIMonitor

Google AppEngine application that monitors server API
Python
25
star
14

GAEMobileAnalytics

Google AppEngine Analytics for Mobile Applications
Objective-C
17
star
15

CAMediaTimingFunctionVisualizer

iPad app to preview animation based on custom animation curve created
Objective-C
17
star
16

Singapore-Bus-Services

Singapore Bus Services
6
star
17

rfremote-fan-api

API to control RF fan using pilight in Raspberry Pi
Python
5
star
18

SubRip-Parser-for-iOS

Objective-C
5
star
19

homebridge-rfremote-fan

HomeBridge plugin to replace RF remote control for fans
JavaScript
3
star