Skip to content
it's a enhanced version of leaves,for zooming pdf
Objective-C Perl
Find file
Latest commit 01f5f69 @lyltina lyltina 修改README
Failed to load latest commit information.
Classes fix memory issue
Leaves.xcodeproj 无~~~~
Leaves for all project
Other Sources for all project
Resources-iPad for all project
Resources for all project
LICENSE for all project
Leaves-Info.plist for all project
Leaves_Prefix.pch for all project
README 修改README
README.markdown for all project
main.m for all project

README.markdown

Leaves

Leaves is an simple way to present a page-turning interface similar to Apple's iBooks. It comprises two classes, LeavesView and LeavesViewController, and occupies less than 100 kB compiled. It uses only public APIs, sacrificing a portion of iBooks' visual flair to ensure that your application is safe for submission to the App Store.

This branch of Leaves supports:

  • Text, images, PDFs -- anything that can be rendered in a graphics context
  • Drag or tap to turn the page
  • iPad--sized display areas
  • Swipe gestures
  • Two-page landscape view

Leaves does not currently support:

  • Interactive elements on the page

This branch of Leaves requires iPhone OS 3.2 or later (support for UIGestureRecognizer).

Installation

Add the files in the Leaves subdirectory to your Xcode project and ensure that you are linking against QuartzCore.framework.

Getting Started

Creating a page-turning interface is as simple as subclassing LeavesViewController:

@interface ColorSwatchViewController : LeavesViewController
@end

...and implementing the LeavesViewDataSource protocol:

@implementation ColorSwatchViewController

- (NSUInteger) numberOfPagesInLeavesView:(LeavesView*)leavesView {
    return 10;
}

- (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx {
    CGContextSetFillColorWithColor(ctx, [[UIColor colorWithHue:index/10.0 
                                                    saturation:0.8
                                                    brightness:0.8 
                                                         alpha:1.0] CGColor]);
    CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
}

@end

For more sophisticated examples, build the Xcode project included with Leaves.

Notes

Leaves is 100% free to use for any purpose, but donations are always appreciated and will allow me to spend more time making it the best UIView subclass it can be.

The best way to get an answer to your question about programming with Leaves is the Leaves Developers mailing list, which I keep an eye on. But if you find a bug, be sure to visit the tracker or message me directly.

Something went wrong with that request. Please try again.