Giter Site home page Giter Site logo

jhchainableanimations's People

Contributors

ayastrebov avatar biinngg avatar draveness avatar gtennis avatar jeehut avatar jhurray avatar jogu avatar xcxcxc 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  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

jhchainableanimations's Issues

Stop (cancel), pause, resume animation

Hi! Thank you for so awesome animation library.

A wanted to ask you to add animation controlling features like stopping, pausing and resuming animations.

Order of callbacks

Hi!
I test version 2 and found that the callbacks pre and post are called at the same time:

JHChainableAnimator *animator = [[JHChainableAnimator alloc] initWithView:self.label];
    animator.
    transformScale(0.01f).makeOpacity(0.0f).postAnimationBlock(@weakself(^() ){
        NSLog(@"postAnimationBlock %@",[NSDate date]);
    }@weakselfend).
    preAnimationBlock(@weakself(^() ){
        NSLog(@"preAnimationBlock %@",[NSDate date]);
    }@weakselfend).
    animationBlock(@weakself(^() ){
        NSLog(@"animationBlock %@",[NSDate date]);
    }@weakselfend).
    thenAfter(10.0f).
    postAnimationBlock(@weakself(^() ){
        NSLog(@"postAnimationBlock %@",[NSDate date]);
    }@weakselfend).
    animationBlock(@weakself(^() ){
        NSLog(@"animationBlock %@",[NSDate date]);
    }@weakselfend).
    preAnimationBlock(@weakself(^() ){
        NSLog(@"preAnimationBlock %@",[NSDate date]);
    }@weakselfend).
   transformScale(100.0f).makeOpacity(1.0f).animate(10.5f);

output:

preAnimationBlock 2017-02-07 16:53:35 +0000
animationBlock 2017-02-07 16:53:35 +0000
postAnimationBlock 2017-02-07 16:53:35 +0000

preAnimationBlock 2017-02-07 16:53:45 +0000
animationBlock 2017-02-07 16:53:45 +0000
postAnimationBlock 2017-02-07 16:53:45

This is a bug or something I do not understand?

MakeScale Issue in v1.3.0

MakeScale do not any animation, it transform immediately.

view.makeScale(.9).thenAfater(2)
.rotate(3)
.animate(3);

Repeat animation group?

Is there an easy way to repeat an animation at the moment? It would be great to see something like view.makeScale(2.0).repeat(4).animate(3.0).

makeScale scales bounds

I was expecting it to apply a scaling CGAffineTransform.

Not many views scale well by adjusting their bounds, for me I was trying to scale a UILabel, which by default just truncates the text when smaller.

Stop support for iOS 8/7?

the minimum deployment target is iOS9 which is declare in "JHChainableAnimations.podspec" file:
s.ios.deployment_target = '9.0'

Emmmmm...

Some animation can not be achieved when it is completely unrelated to other animations, such as changing the background color or transparency, and these animations are irrelevant to deformation or displacement animation.

Grow Action and Shrink Chain not working

I want to grow (scale) a view set a new value and then shrink (scale) the view to its original size again.

I tried to do:

    var isGrowing = true
    self.badgeView?.transformScale()(2).animate()(3)
      self.badgeView?.animationCompletion = {
        if isGrowing {
          isGrowing = false
          self.badgeView?.badgeText = "\(self.selectionCounter)"
          self.badgeView?.transformScale()(1).animate()(3)
        }
    }

But it does not work that way. How can I fix this?

Combine animations with different durations

Hello! I need to fade in a view while it is moving to its destination point.
So I setup it with zero alpha and start coordinates, then I need to move it to the destination in 1 second and change its alpha to 1 in 0.3 second.

Is there a possibility to do that?
a.makeOpacity(1).animate(0.3).moveX(destination).animate(1) doesn't work.

Updating Animation Parameters Mid-Animation

Say you want to move something from Point A to Point B, but while it's moving, it now needs to continue on through B to C.

Is there a way to accomplish this currently?

Doing it in the animateWithCompletion block results in a stop and go..

(The functionality is built into UIView animateWithDuration w/ the UIViewAnimationOptionBeginFromCurrentState option)

could add many frequently-used animations effects?

i'm chinese,english is pool, thank you !!!!!

i like those animations: .spring and .bounce

i have some Advices:

  1. spring and bounce could give us Parameter,like this : .spring(.5f) .bouce(1.0f) ?? it will be more Flexible.

2.can you provide other frequently-used animations effects? like shake, fade,flash,
i know a framework named canvas,but it did not support iOS 7's autoLayout, it's useful,but has many bugs, i think your framework could replace it Completely.
canvas,you should know it: https://github.com/CanvasPod/Canvas

thank you very much!!!!!

Not working for UILabel

_counterLabel
    .wait(0.2)
    .makeScale(2)
    .spring
    .animate(0.8);

After calling this code, the label is shifted to the left and not scaling!

Swift?

Is there a way to get this working with Swift?

I can get it to compile by changing:

#import "NSBKeyframeAnimationFunctions/NSBKeyframeAnimationFunctions.h"

to:

#import "NSBKeyframeAnimationFunctions.h"

but attempting to animate a button:

button.moveX(50).animate(0.5)

doesn't compile.

Compile error

XCode throw an error " Use of '@import' when modules are disable", how should I solve the problem, thank you.

Need some help please

animator!.moveY(50).animate(1.0)

Keep getting an error on the above line that says:

Argument passed to call that takes no arguments

Please Help!!!

UIView is blinking at the end of animation on a Device

First, thanks @jhurray for the awesome lib. Great work!

Now back to the problem - has anyone encountered a blinking issue? No matter what animation (move, scale) I'm using, each view (with its own animator) blinks with white color at the end of an animation.

This is happening on an iPhone 6 device, iOS 10.3. Works smoothly on a Simulator, Xcode 9.0. Any thoughts?

I'm using Swift and pod 'ChainableAnimations', '~> 3.0.1'

autoLayout animation

thank you for this powerful frameworks!

i have some questions:

1.chainAnim with autoLaytou is useless,e.g.:
self.redView.makeConstraint(self.leftMarginC,100).animate(2.0f); //do not has any effects

2.cloud add duratiion for each chain? e.g.:
self.redView.moveX(100).duration(1.5f).thenAfter.moveY(100).duration(.8f).animat;

3.i could not understand the diff between wait/delay and thenAfter?

thank you!

Can I spring when scale is 1.0?

I want to spring like this:
self.myView.makeScale(1.0).spring.animate(1.0);

but myView not animation.

I like this. Thanks!

animate repeat

i have implement one animate, and i want to repeat execute this animate,how can i implement it?

New version does not work

Hi,

I tried to add this library in my project, but the last changes of the last commit does not appears actually if I browse in the code. Maybe, because the name of the last version (3.0.1) is the same as the previous one.

Please, fix it. Thanks

Change Request: Spring animation

In current implementation spring easing is just an easeOutElastic now. I want spring animation has dampingRatio and velocity parameters and to be implemented as a real spring animation.

Thank you.

How do I repeat composite animation

For example, I want a view repeat a "up-down animation".
code:
JHChainableAnimator *anim = [[JHChainableAnimator alloc] initWithView:view];
anim.moveY(10).thenAfter(0.2).moveY(-10).animateWithRepeat(0.2,5);

But the view will move down once and move up five times

easeInCirc

Hi,
trying to use easeInCirc effect I got a runtime error. With the same line of code but a different effect everything works fine.

myView.moveXY(-20,-150).easeInCirc.makeScale(2.0).makeOpacity(1.0).animate(0.8);

Error: file JHKeyframeAnimation.m line 166

Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void >CGPathAddLineToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file >Paths/CGPath.cc, line 265.

anchorCenter issue in v1.3.0

It make a bug when we use .anchorCenter because current layer.anchorPoint is (0.5, 0.5).

-(void) makeAnchorFromX:(CGFloat) x Y:(CGFloat)y {
    JHAnimationCalculationAction action = ^void(UIView *weakSelf){
        CGPoint anchorPoint = CGPointMake(x, y);
//  I annote this make right.
//        if (CGPointEqualToPoint(anchorPoint, weakSelf.layer.anchorPoint)) {
//            return;
//        }
        CGPoint newPoint = CGPointMake(weakSelf.bounds.size.width * anchorPoint.x,
                                       weakSelf.bounds.size.height * anchorPoint.y);
        CGPoint oldPoint = CGPointMake(weakSelf.bounds.size.width * weakSelf.layer.anchorPoint.x,
                                       weakSelf.bounds.size.height * weakSelf.layer.anchorPoint.y);

        newPoint = CGPointApplyAffineTransform(newPoint, weakSelf.transform);
        oldPoint = CGPointApplyAffineTransform(oldPoint, weakSelf.transform);

        CGPoint position = weakSelf.layer.position;

        position.x -= oldPoint.x;
        position.x += newPoint.x;

        position.y -= oldPoint.y;
        position.y += newPoint.y;

        weakSelf.layer.position = position;
        weakSelf.layer.anchorPoint = anchorPoint;
    };
    NSMutableArray *lastCalculationActions = [self.JHAnimationCalculationActions lastObject];
    [lastCalculationActions insertObject:action atIndex:0];
}

Out Test

view
.transformScale(.5)
.anchorCenter
.animate(5);

It scale by Top-Left not Center.

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.