Leaves
A page-turning interface for iOS apps
Install / Use
/learn @brow/LeavesREADME
#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
- Add the files in the
Leavessubdirectory to your Xcode project. - 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 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 by ole (blog post)
- Zooming by hammerlyrodrigo
- ARC by tjboudreaux
- Retina support by Vortec4800
Articles
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
