Giter Site home page Giter Site logo

yfoldview's Introduction

YFoldView

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.

Features

  • Customize the number of paper folds
  • Support four opening directions
  • Adjust animation duration
  • Delegate functions to react to events events
  • Automatic Reference Counting support

Installation

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

Usage

(see example Xcode project in /Demo)

Close view transition

YFoldView* folding=[YFoldView closeView:self.view 
 			           withNumberOfFold:5 
				                  onWay:yFoldViewBottomToTop 
	   		       duration:2 
      		        	withDelegate:self];

Open view transition:

[folding openAnimatedDuration:2];

To fold View Horizontaly

[folding horizontalFoldWithHeight:self.view.bounds.size.height/3];

To fold View Verticaly

[folding verticalFoldWithWidth:self.view.bounds.size.width/3];

Delegate:

@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

Demo

(see demo video on Vimeo) (see demo video on Vimeo)

Credit

YFoldView is brought to you by [Yooneo (Gerald HUARD)(http://www.yooneo.com/)]

yfoldview's People

Contributors

geraldhuard avatar

Stargazers

周肇东 avatar Farteen avatar HongHao Zhang avatar Surendra Kumar avatar ig avatar Gunjot Singh avatar Heshan Wanigasooriya avatar  avatar Daniel Ran Lehmann avatar Wendy avatar ɥʇɐɯɐʞ ɥsᴉɹɐɥ avatar tikhop avatar Kojiro Futamura avatar Sabrina Jiang avatar Timur Kuchkarov avatar Alexander Koz. avatar  avatar chakming avatar hjy avatar Yann Moussaba avatar Chris Micali avatar  avatar  avatar Lukáš Kubovič avatar Sagar avatar Oleg  avatar Oleksandr Lobunets avatar mayulu avatar Darcy Liu avatar Boris Bügling avatar Steven Baughman avatar JT5D avatar Eric Chuang avatar Wouter van den Broek avatar Eric Guo avatar Mike Trummer avatar Adam Smolarek avatar flypigz avatar Sebastien Rousseau avatar  avatar André Sousa avatar Xiang Wei avatar bitware avatar Trunal Bhanse avatar Brian Guarraci avatar Benedikt Lecheler avatar  avatar  avatar  avatar  avatar  avatar Chiu Hoi Po avatar Max Stottrop avatar Tiago Alves avatar Rakuraku Jyo avatar Cesare avatar Daniele Vian avatar Cristiano avatar Blake Schwendiman avatar Andy Chentsov avatar Willi Wu avatar Torsten Curdt avatar

Watchers

 avatar Ian Chia avatar mayulu avatar James Cloos avatar  avatar Audrey avatar SALVATORE avatar  avatar

yfoldview's Issues

Last step in opening

Hi,

I am noticing that, during the animated opening, the last "step" is not as smooth as others.
There is a sort of little "jump" to the final state.
The same does not happen, when you close it.
Have you any idea how to solve it?

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.