Coder Social home page Coder Social logo

xyorigami's Introduction

XYOrigami

XYOrigami is an simple and easy-to-use view transition for iOS app. Inspired by HonCheng’s next train video, XYOrigami is a simpler version of folding transition. It is an add-on category of UIView, with two functions you can animate showing/hiding another view.

[UPDATE] If you are looking for dragging support, please check out HonCheng's git.

Features

  • Category of UIView
  • Customize the number of paper folds
  • Support two opening directions(left & right)
  • Easy adjust animation duration
  • Completion block call back function
  • ARC(Automatic Reference Counting) support
  • Support top and bottom directions[UPDATE]

Installation

  • Drag the XYOrigami/XYOrigami folder into your project.
  • Add the QuartzCore framework to your project.

Usage

(see example Xcode project in /Demo)

Open view transition

[self.centerView showOrigamiTransitionWith:self.sideView
							 NumberOfFolds:2
								  Duration:0.5
								 Direction:XYOrigamiDirectionFromRight
								completion:^(BOOL finished) {
									NSLog(@"animation completed.");
								}];

Close view transition:

[self.centerView hideOrigamiTransitionWith:self.sideView
							 NumberOfFolds:2
								  Duration:0.5
								 Direction:XYOrigamiDirectionFromRight
								completion:^(BOOL finished) {
									NSLog(@"animation completed.");
								}];

Demo

(see demo video on Vimeo)

image

Credit

XYOrigami is brought to you by XY Feng

xyorigami's People

Contributors

xyfeng 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  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  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  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

xyorigami's Issues

Not Working

I've tried to integrate with my app to no avail. Error:
[UIView hideOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:]: unrecognized selector sent to instance 0x836a830

Code:
[self.webHolder hideOrigamiTransitionWith:self.pinkView NumberOfFolds:2 Duration:0.5 Direction:XYOrigamiDirectionFromLeft completion:^(BOOL finished) {NSLog(@"animation completed.");}];

Any ideas?

Top down animation

Hi,

thanks for sharing this nice lib.
Any hint to add the other two animations, top-down and bottom-up?

Allow folding from top and bottom

I'm trying to add this myself, but my math is a little rusty, and the only animations I have worked with are from tutorials. So I am hoping you can help.

I would like to be able to fold not only from left or right, but also from top or bottom. (In other words, putting the Y in XYOrigami ;-)

I will continue to struggle with this, and will contribute my changes if I ever finish it. If, however, you have the time and the talent and want to add this, I would greatly appreciate it.

Any helpful hints to get me heading in the right direction would also be appreciated. Especially when it comes to the animation, and the math involved to set those up.

Swift Support

Has anyone started converting this to Swift? If not may do.

showOrigami 'viewB' hiding 'viewA' - hideOrigami 'viewB' showing 'viewC'

Hi! Thank you for sharing this library, it's very nice!

Yesterday I used it in a UITabbarController, I need to use the origami animation just to show / hide 1 view controller (which is a map).
The problem seems to be that when you call the hideOrigami... your class works fine only if you use exactly the same views which you used when you called the showOrigami, but in the navigation flow when I need to hide my map viewcontroller, the view which will be displayed could not match the view previously hidden.

Why the state is static? I could want more instances of the XYOrigami working indipendently...

Landscape support

Hi there,

First of all, awesome library.
I am getting stuck at trying to implement XYOrigamiDirectionFromTop feature in landscape orientation. How may I achieve that ? Suggest me please.

Thanks.

Linker Error

I added your library to my project and imported it into a view controller. In a method, I transition from one view to another using the "showOrigamiTransitionWith:NumberOfFolds:..." method. When I attempt to build, the build fails with the following errors (sorry that the error is long):


Ld "/Users/John/Library/Developer/Xcode/DerivedData/Guess_Who!-cladfxruebegwfgbwcdufbpbuldh/Build/Products/Debug-iphonesimulator/Guess Who!.app/Guess Who!" normal i386
    cd "/Projects/Technology/Programming/Programming Projects/Objective-C Programs/iPhone Applications/Projects/Guess Who!"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Applications/Developer/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Developer/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Developer/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Developer/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk "-L/Users/John/Library/Developer/Xcode/DerivedData/Guess_Who!-cladfxruebegwfgbwcdufbpbuldh/Build/Products/Debug-iphonesimulator" "-F/Users/John/Library/Developer/Xcode/DerivedData/Guess_Who!-cladfxruebegwfgbwcdufbpbuldh/Build/Products/Debug-iphonesimulator" -filelist "/Users/John/Library/Developer/Xcode/DerivedData/Guess_Who!-cladfxruebegwfgbwcdufbpbuldh/Build/Intermediates/Guess Who!.build/Debug-iphonesimulator/Guess Who!.build/Objects-normal/i386/Guess Who!.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework AddressBook -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/John/Library/Developer/Xcode/DerivedData/Guess_Who!-cladfxruebegwfgbwcdufbpbuldh/Build/Products/Debug-iphonesimulator/Guess Who!.app/Guess Who!"

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CAKeyframeAnimation", referenced from:
      objc-class-ref in UIView+Origami.o
      l_OBJC_$_CATEGORY_CAKeyframeAnimation_$_Parametric in UIView+Origami.o
  "_OBJC_CLASS_$_CATransformLayer", referenced from:
      objc-class-ref in UIView+Origami.o
  "_OBJC_CLASS_$_CALayer", referenced from:
      objc-class-ref in UIView+Origami.o
  "_OBJC_CLASS_$_CAGradientLayer", referenced from:
      objc-class-ref in UIView+Origami.o
  "_OBJC_CLASS_$_CABasicAnimation", referenced from:
      objc-class-ref in UIView+Origami.o
  "_OBJC_CLASS_$_CATransaction", referenced from:
      objc-class-ref in UIView+Origami.o
  "_CATransform3DIdentity", referenced from:
      -[UIView(Origami) showOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
      -[UIView(Origami) hideOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
  "_kCAAnimationLinear", referenced from:
      +[CAKeyframeAnimation(Parametric) animationWithKeyPath:function:fromValue:toValue:] in UIView+Origami.o
  "_kCAFillModeForwards", referenced from:
      -[UIView(Origami) showOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
      -[UIView(Origami) hideOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
  "_kCATransactionAnimationDuration", referenced from:
      -[UIView(Origami) showOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
      -[UIView(Origami) hideOrigamiTransitionWith:NumberOfFolds:Duration:Direction:completion:] in UIView+Origami.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

A small bug

Hello - thank you for the amazing work .
I'm having an issue - when the app is going to be minimized , and then when i return back , the app will not response to the hide button .

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.