GithubHelp home page GithubHelp logo

ansani / leaves Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ole/leaves

36.0 4.0 7.0 6.11 MB

An iBooks-like page-turning interface for iPhone and iPad apps using only public APIs.

Home Page: http://groups.google.com/group/leaves-developers

License: Other

C 12.98% Objective-C 87.02%

leaves's Introduction

#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.

leaves's People

Contributors

brow avatar ole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

leaves's Issues

PDF Running Slowly with Kanji in PDF

Hi there,

I just tried importing some Kanji PDF's (a PDF of about 2.2Mb) and the engine seems to be running very slowly. After turning the page, the shadow remains around the spine for close to a second before the page turn "finalises". Sometimes when turning backward, the engine seems to refuse to turn the page at all.

I have tested to see if this is file size with a non-kanji PDF of >3Mb and the same issue doesn't exist.

app crashes during the zoom

When I zoom the pdf, the images overlap and then the application crashes after a series of memory warnings!! how can i fix it??

Keeping the fold visible

When in two-page mode when you turn the page, a fold appears and slowly "moves" to the center of the screen. When the transition is done, it immediately disappears, leaving you without any page seperation.
Would it be possible to keep the fold visible? I've tried modifying it myself, but could find a way.

Flicking vertical lines in iPad 2

Running the PDF viewer on a iPad 2 Device (iOS 4.3) show some random flicking lines while turning the page.
The line has white color and immediately disappears after showing up (only one frame?).

Anyone else seeing this issue?

Kind regards
Martin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.