YFoldView is an simple and easy-to-use class for iOS UIView. YFoldView provide folding transition to sho or to hide a view. The Class YFoldView has different method to fold UIView Element.
- Customize the number of paper folds
- Support four opening directions
- Adjust animation duration
- Delegate functions to react to events events
- Automatic Reference Counting support
- Add YFoldView.h/YFoldView.h files to your project and Import YFoldView.h in your file you want to use
- Add the QuartzCore framework to your project.
(see example Xcode project in /Demo)
YFoldView* folding=[YFoldView closeView:self.view
withNumberOfFold:5
onWay:yFoldViewBottomToTop
duration:2
withDelegate:self];
[folding openAnimatedDuration:2];
[folding horizontalFoldWithHeight:self.view.bounds.size.height/3];
[folding verticalFoldWithWidth:self.view.bounds.size.width/3];
@protocol YFoldViewDelegate <NSObject>
@optional
/**
Called when the view ids totally opened
@param foldview : YFoldView Class
@param view : the UIView Object used
@param opened : YES if it's opened
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view isOpen:(BOOL)opened;
/**
Called when the view is totally closed
@param foldview : YFoldView Class
@param view : the UIView Object used
@param opened : YES if it's opened
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view isClose:(BOOL)closed;
/**
Called when the height of the view changed
@param foldview : YFoldView Class
@param view : the UIView Object used
@param h : current height of view:w
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view heightChanged:(CGFloat)h;
/**
Called when the width of the view changed
@param foldview : YFoldView Class
@param view : the UIView Object used
@param w : current width of view:w
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view widthChanged:(CGFloat)w;
/**
Called when the size (width or height) of the view changed
@param foldview : YFoldView Class
@param view : the UIView Object used
@param size : current size:w
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view sizeChanged:(CGSize)size;
/**
Called when animation finished
@param foldview : YFoldView Class
@param view : the UIView Object used
@param finished : YES when finished
*/
-(void) yfoldview:(YFoldView*)foldview view:(UIView*)view animFinished:(BOOL)finished;
@end
(see demo video on Vimeo) (see demo video on Vimeo)
YFoldView is brought to you by [Yooneo (Gerald HUARD)(http://www.yooneo.com/)]