Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brow/leaves
A page-turning interface for iOS apps
https://github.com/brow/leaves
Last synced: 4 days ago
JSON representation
A page-turning interface for iOS apps
- Host: GitHub
- URL: https://github.com/brow/leaves
- Owner: brow
- License: other
- Created: 2010-04-20T05:53:04.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2017-11-24T03:19:52.000Z (about 7 years ago)
- Last Synced: 2024-11-21T21:03:05.326Z (21 days ago)
- Language: Objective-C
- Homepage:
- Size: 3.69 MB
- Stars: 1,438
- Watchers: 48
- Forks: 332
- Open Issues: 8
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
- awesome - leaves - A page-turning interface for iOS apps (etc)
- awesome - leaves - A page-turning interface for iOS apps (etc)
README
#Leaves
Leaves is an animated interface for navigating through a sequence of images
using page-turning gestures. As of iOS 5, Leaves is mostly obsoleted by
[UIPageViewController].Leaves requires iOS 3.0 or later.
##Installation
1. Add the files in the `Leaves` subdirectory to your Xcode project.
2. Ensure that your target links against `QuartzCore.framework`.##Usage
Creating a page-turning view controller is as simple as subclassing
[LeavesViewController][]:#import "LeavesViewController.h"
@interface ColorSwatchViewController : LeavesViewController
@end...and implementing the [LeavesViewDataSource][LeavesView] protocol:
@implementation ColorSwatchViewController
- (NSUInteger)numberOfPagesInLeavesView:(LeavesView*)leavesView {
return 10;
}- (void)renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)context {
CGContextSetFillColorWithColor(
context,
[[UIColor colorWithHue:index/10.0
saturation:0.8
brightness:0.8
alpha:1.0] CGColor]);
CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
}@end
You may also use [LeavesView] directly. For more examples, see the included
`LeavesExamples` project.##Forks
* [Two-page view](https://github.com/ole/leaves/tree/twopages) by [ole](https://github.com/ole) ([blog post](http://oleb.net/blog/2010/06/app-store-safe-page-curl-animations/))
* [Zooming](https://github.com/hammerlyrodrigo/leaves) by [hammerlyrodrigo](https://github.com/hammerlyrodrigo)
* [ARC](https://github.com/tjboudreaux/leaves) by [tjboudreaux](https://github.com/tjboudreaux)
* [Retina support](https://github.com/Vortec4800/leaves) by [Vortec4800](https://github.com/Vortec4800)## Articles
* [App Store-safe Page Curl animations](http://oleb.net/blog/2010/06/app-store-safe-page-curl-animations/)
* [How To Add A Slick iBooks Like Page Turning Effect Into Your Apps](http://maniacdev.com/2010/06/lick-ibooks-like-page-turning-effect)
* [Building an iPad Reader for _War of the Worlds_](http://mobile.tutsplus.com/tutorials/iphone/building-an-ipad-reader-for-war-of-the-worlds/)[UIPageViewController]: https://developer.apple.com/library/ios/documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
[LeavesViewController]: https://github.com/brow/leaves/blob/master/Leaves/LeavesViewController.h
[LeavesView]: https://github.com/brow/leaves/blob/master/Leaves/LeavesView.h