Coder Social home page Coder Social logo

jazzhands's Introduction

Open Source at IFTTT

Jazz Hands

CocoaPods Version Build Status Coverage Status

Jazz Hands is a simple keyframe-based animation framework for UIKit. Animations can be controlled via gestures, scroll views, KVO, or ReactiveCocoa.

Jazz Hands

Jazz Hands is used extensively in IF and DO by IFTTT for iPhone and iPad, most famously in the app intro.

##Demo App

Open JazzHandsDemo.xcworkspace to see a simple demonstration of moving, scaling, fading, and transforming views in a scrolling app intro.

To run the example project, clone the repo, and run pod install from the Example directory.

##JazzHands in Swift

Looking to incorporate Jazz Hands into your Swift project? Check out RazzleDazzle, our brand new scrolling keyframe animations library reimagined in Swift.

##Installation

JazzHands is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JazzHands"

You may alternatively just copy the contents of the JazzHands folder into your project.

##Quick Start

First, add JazzHands to your UIViewController.

#import <IFTTTJazzHands.h>

Now, create an Animator to manage all of the animations in this UIViewController.

@property (nonatomic, strong) IFTTTAnimator *animator;

// later...

self.animator = [IFTTTAnimator new];

Create an animation for a view that you want to animate. There are multiple types of animation that can be applied to a view. For this example, we'll use IFTTTAlphaAnimation, which fades a view in and out.

IFTTTAlphaAnimation *alphaAnimation = [IFTTTAlphaAnimation animationWithView: viewThatYouWantToAnimate];

Register the animation with the animator.

[self.animator addAnimation: alphaAnimation];

Add some keyframes to the animation. Let's fade this view out between times 30 and 60.

[alphaAnimation addKeyframeForTime:30 alpha:1.f];
[alphaAnimation addKeyframeForTime:60 alpha:0.f];

Now, to animate the view, tell the animator what time it is. For example, to tie this animation to a UIScrollView, notify the animator of time in the scroller's delegate method.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
  [super scrollViewDidScroll:scrollView];
  [self.animator animate:scrollView.contentOffset.x];
}

This will produce an effect where the view will be fully faded in and visible for scroll positions 0 to 30. Between scroll positions 30 and 60, the view will fade out to be invisible, and it will stay faded out for scroll positions greater than 60.

##Animation Types

Jazz Hands supports several types of animations:

  • IFTTTAlphaAnimation animates the alpha property (creates fade effects).
  • IFTTTRotationAnimation animates a rotation transform in degrees (for rotation effects).
  • IFTTTBackgroundColorAnimation animates the backgroundColor property.
  • IFTTTCornerRadiusAnimation animates the layer.cornerRadius property.
  • IFTTTHideAnimation animates the hidden property (hides and shows views).
  • IFTTTScaleAnimation applies a scaling transform (to scale view sizes).
  • IFTTTTranslationAnimation applies a translation transform (to translate view position).
  • IFTTTTransform3DAnimation animates the layer.transform property (for 3D transforms).
  • IFTTTTextColorAnimation animates the textColor property of a UILabel.
  • IFTTTFillColorAnimation animates the fillColor property of a CAShapeLayer.
  • IFTTTStrokeStartAnimation animates the strokeStart property of a CAShapeLayer (does not work with IFTTTStrokeEndAnimation).
  • IFTTTStrokeEndAnimation animates the strokeEnd property of a CAShapeLayer (does not work with IFTTTStrokeStartAnimation).
  • IFTTTPathPositionAnimation animates the layer.position property of a UIView.
  • IFTTTConstraintConstantAnimation animates an AutoLayout constraint constant.
  • IFTTTConstraintMultiplierAnimation animates an AutoLayout constraint constant as a multiple of an attribute of another view (to offset or resize views based on another view's size)
  • IFTTTScrollViewPageConstraintAnimation animates an AutoLayout constraint constant to place a view on a scroll view page (to position views on a scrollView using AutoLayout)
  • IFTTTFrameAnimation animates the frame property (moves and sizes views. Not compatible with AutoLayout).

##More Examples

Easy Paging Scrollview Layouts in an AutoLayout World

JazzHands's keepView:onPage: method of the IFTTTAnimatedPagingScrollViewController is a super easy way to lay out a paging scroll view that does what you expect it to when your app is rotated or used in the new split-screen iPad views of iOS9, a notoriously tricky aspect of getting your apps fully AutoLayout-ready. JazzHands sets up an AutoLayout-friendly paging scroll view controller for you, and all you need to do to make your layout respond properly to any view size changes is tell JazzHands which page you'd like things on.

As a bonus, because it's built on top of the animations library, you can even tell JazzHands that you'd like one of your views to show up on multiple pages while other views scroll past, with a single call to keepView:onPages:.

To see the new JazzHands 2.0 AutoLayout magic in action, check out the example project.

###ReactiveCocoa

Say you want to perform some animations based on a UITableView's scroll offset, but you don't want to be the delegate for that table? ReactiveCocoa is perfect for that.

[RACObserve(self.tableView, contentOffset) subscribeNext:^(NSValue *value) {
	CGFloat y = self.tableView.contentOffset.y;
	[self.animator animate:y];
}];

KVO

Or, maybe you want to animate some views based upon the position of another view? Jazz Hands works well with KVO.

- (void)viewDidLoad
{
  [self.viewToMirror addObserver:self
                      forKeyPath:@"frame"
                         options:NSKeyValueObservingOptionInitial
                         context:nil];
}

- (void)observeValueForKeyPath:(NSString *)keyPath
                      ofObject:(id)object
                        change:(NSDictionary *)change
                       context:(void *)context {

  if ([keyPath isEqualToString:@"frame"]) {
    [self.animator animate:CGRectGetMinY(self.viewToMirror.frame)];
  } else {
    [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
  }
}

Gestures

Jazz Hands is flexible enough that it can accept timer input from many different types of sources, including UIGestureRecognizer.

- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer
{
	[self.animator animate:[recognizer locationOfTouch:0 inView:self.view].x];
}

Notes

An animator can only handle one animation per type per view. If you want multiple animations of the same type on a view, use keyframes.

IFTTTFrameAnimation is not compatible with AutoLayout or any of the constraint animations.

Looking for libraries to build awesome keyframe animations like JazzHands on Android? Check out SparkleMotion.

Contributors

Contributing

  1. Fork it ( https://github.com/[my-github-username]/JazzHands/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Copyright 2015 IFTTT Inc.

jazzhands's People

Contributors

alexggordon avatar brennanmke avatar camdenfullmer avatar devinfoley avatar dive avatar emptyway avatar jeremyflores avatar jhersh avatar jsm174 avatar lauraskelton avatar maxmeyers avatar natanrolnik avatar pbrewczynski avatar pnre avatar qfish avatar rastersize avatar revolter avatar seanmctex avatar sugarmo avatar tadeokondrak avatar willsbor avatar xinsight 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  avatar

jazzhands's Issues

Help to put a UIImageView to the right or to the left

Hello,

I do not see the way to make the animation that you have on your gif on the page 4 and 5. First at all I can not put the UIImageView where I want to on the next page move it.

I can put it where I want on Y axis but not on the X axis. On your Unicorn example you have everything centered on the X axis but not moved to the right or the left.
Could you help me?

Thanks in advance

Is it possible to animate when page scroll stops?

I understand that Jazzhands's concept is keyframe, so the animations happen during page scrolling.

I'd like to know if it's possible to do some animations when scroll stops?
For example: after (not during) I scroll from page 1 to page 2, I can zoom in/out a button in page 2.

If it's possible, what is the best practice to do it?

UIButton does not work

Trying to animate a UIButton does not work. UILabel animated fine, and if I put the UIButton inside a UIView and animate the UIView, everything works.

Installation issue

By simple drag and drop of the src files in custom project. I get 10 errors of similiar kind.
What is the myth behind ?
Unknown type name 'IFTTTFrameAnimation'; did you mean 'IFTTTAnimation'?

Animation Issues

Animation dosent work when using classes instead of cocoa pods.
i am using same code of demo. but no animation happening in my demo.

Duplicate frames generated between each pair of key frames

I'm seeing what looked like rounding errors in the animations but turned out to be a duplicate frame generated between each pair of key frames. This code in IFTTTAnimation.m's addKeyFrame: iterates over all pairs of key frames and generates entries in the timeline.

 for (NSUInteger i = 0; i < self.keyFrames.count - 1; i++) {
    IFTTTAnimationKeyFrame *currentKeyFrame = [self.keyFrames objectAtIndex:i];
    IFTTTAnimationKeyFrame *nextKeyFrame = [self.keyFrames objectAtIndex:i+1];

    for (NSInteger j = currentKeyFrame.time; j <= nextKeyFrame.time; j++) {
        [self.timeline addObject:[self frameForTime:j startKeyFrame:currentKeyFrame endKeyFrame:nextKeyFrame]];
    }
}

If you follow the logic you will see that the final 'j' value in the inner loop ( nextKeyFrame.time) is the same as the first value (currentKeyFrame.time) for the next iteration of the outer loop. Changing the terminating condition for the inner loop to use < nextKeyFrame.time instead of <= will result in the final key frame not being generated, so that's not the right fix.

The simplest way (in my opinion) to avoid the duplicate is to begin all but the first iteration of the inner loop at currentKeyFrame.time+1:

for (NSInteger j = currentKeyFrame.time + (i == 0 ? 0 : 1); j <= nextKeyFrame.time; j++) {

An alternate would be stop the iteration of the inner loop one short except for the final outer loop iteration.

Handle Gestures

In your pan example you wrote:

- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
  [self.animator animate:[recognizer locationOfTouch:0 inView:self.view]];
}

This is wrong because locationOfTouchwill return a CGPoint is there a way to fix that?

IFTTTScrollViewPageConstraintAnimation ignores initial constraint constants

Hi,
Using IFTTTScrollViewPageConstraintAnimation locks the animated UIView to the center of the screen (or left / right according to the position attribute).
If the constraint used to initialise it using '+animationWithSuperview:constraint:pageWidth:attribute:' had a offset constant other then 0 it is reset and ignored.
Thanx,
Amir

Semantic versioning?

So I didn't know where to post this so figured I'd do it here - 0.0.4 breaks the 0.0.3 method of init'ing the scroll view (you now need to do it in viewDidLoad as opposed to the view controller's init method). I based this on the Example project. Thing is, I didn't even notice my tour break until we were running pre-release tests and was kind of surprised. Turns out the '>' operator in cocoapods uses semantic versioning, which means that '>' applies to 0.0.3 and any version up to but not including 0.1, so my JazzHands got updated to 0.0.4 without me realizing it, which broke my implementation.

Should a release going from 0.0.3 to 0.0.4 really break previous implementations, or was I setting it up wrong all along?

Awesome library and thanks for the fantastic work!

Can not re-implement Demo because source file change?

I am trying to re-implement the Demo which the compiler warns me Assignment to readonly property
at the line of code:

- (void)configureAnimation
{
    IFTTTFrameAnimation *wordmarkFrameAnimation = [IFTTTFrameAnimation new];
    wordmarkFrameAnimation.view = self.firstPerson;
                          ^^^^
    [self.animator addAnimation:wordmarkFrameAnimation];
}

I noticed that the IFTTTAnimation.h class in Demo looks like:

@interface IFTTTAnimation : NSObject

@property (strong, nonatomic) UIView *view;
@property (strong, nonatomic) NSMutableArray *keyFrames;

- (id)initWithView:(UIView *)view;

- (void)animate:(NSInteger)time;
- (void)addKeyFrame:(IFTTTAnimationKeyFrame *)keyFrame;

- (IFTTTAnimationFrame *)animationFrameForTime:(NSInteger)time;
- (CGFloat)tweenValueForStartTime:(NSInteger)startTime
                      endTime:(NSInteger)endTime
                   startValue:(CGFloat)startValue
                     endValue:(CGFloat)endValue
                       atTime:(CGFloat)time;

view is a readwrite type property, while in the newest pod, the IFTTTViewAnimation class :

@interface IFTTTViewAnimation : IFTTTAnimation

@property (nonatomic, strong, readonly) UIView *view;

- (instancetype)initWithView:(UIView *)view;
+ (instancetype)animationWithView:(UIView *)view;

@end

view is a readonly property. Any idea?

Hide Animation performs differently on 32 bit and 64 bit devices

@lauraskelton @devinfoley Hi,
I've discovered today that the hide animation performs differently on 64 bit devices than on 32 bit.
It seems that on 64 bit devices the interpolation of hide animation returned a fraction value that was translated to true if it was nonzero, but on 32 bit it was always 0 or 1, never a fraction.
I found that @encode(BOOL) and @encode(char) returned same on 32 bit but not on 64, and NSCFBoolean has a char type.
Please see my pull request. I hope it sticks to the original idea of the method.
Thanx,
Amir.

Only supporting a single keyframe at a given time is an easy source of error

Please correct me if I'm wrong, but it seems that only one IFTTTAnimationKeyFrame can be added to an animation for a given "time". I believe this to be an easy source of confusion. For example, the following doesn't change the view's alpha at all:

        [self.animation addKeyFrames:@[
            [IFTTTAnimationKeyFrame keyFrameWithTime:time0 andFrame:offscreenFrame],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time0 andAlpha:0],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time1 andFrame:view.frame],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time1 andAlpha:1],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time2 andAlpha:0],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time2 andFrame:offscreenFrame],
        ]];

In fact, the above fails silently, only changing the view's frame. but the following does change the alpha:

        [self.animation addKeyFrames:@[
            [IFTTTAnimationKeyFrame keyFrameWithTime:time0 andFrame:offscreenFrame],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time0 + 1 andAlpha:0],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time1 - 1 andFrame:view.frame],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time1 andAlpha:1],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time2 - 1 andAlpha:0],
            [IFTTTAnimationKeyFrame keyFrameWithTime:time2 andFrame:offscreenFrame],
        ]];

Which IOS versions supported?

You should write, which IOS versions supported.
I ve tested Demo app with IOS 6.1 and it crashed:

"Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan nan; nan nan]' "

Unknown external source parameters for `JazzHands`: `path../`

Hi, I am trying to run the demo project but always fail to complete the pod installation.
Can anyone kindly guide me what should I do to make it work ?

$ pod install
Analyzing dependencies
/Library/Ruby/Gems/1.8/gems/cocoapods-0.18.1/lib/cocoapods/executable.rb:55: warning: Insecure world writable dir /usr/local in PATH, mode 040777

CocoaPods 0.29.0 is available.

[!] Unknown external source parameters for JazzHands: path../

Add <UIKit/UIKit.h> to IFTTTAnimator.h

Using XCode 6.4, if you make a brand new project, and do nothing else other then adding a copy of JazzHands, the compile will fail.

.../IFTTTAnimator.h:12:28: Cannot find interface declaration for 'NSObject', superclass of 'IFTTTAnimator'

I believe this happens because precompiled headers are no longer defaulted to on in new projects.

If you simply add an import for UIKit to IFTTTAnimator.h you can get a clean compile.

jazzhands

Animation does not work fluent

I tried the following animation:

First I created a view:

    self.phoneScreen = UIImageView(image: UIImage(named: "screenBlank")!)
    self.phoneScreen?.frame = CGRectMake(0, 0, self.phoneScreen!.frame.width/2, self.phoneScreen!.frame.height/2)
    self.phoneScreen?.center = self.view.center
    self.scrollView.addSubview(self.phoneScreen!)

Then I created the animation:

let phoneScreenAnimation: IFTTTFrameAnimation = IFTTTFrameAnimation(view: self.phoneScreen!)
    self.animator.addAnimation(phoneScreenAnimation)

    phoneScreenAnimation.addKeyFrame(IFTTTAnimationKeyFrame(time: timeForPage(1), andFrame: self.phoneScreen!.frame))
    phoneScreenAnimation.addKeyFrame(IFTTTAnimationKeyFrame(time: timeForPage(2), andFrame: CGRectOffset(self.phoneScreen!.frame, self.view.frame.size.width, 0)))

The function timeForPage is based on your example.

Here is the problem. The animation is running correctly from page 1 to page 2. The problem is that is not very smooth. It shakes a bit, or lets say it vibrates a bit while running. The shaking is around the x axis while the translation is running. It looks like there is a lot of computation and that the rendering of the view could not handle painting that fast. Is there something wrong with my code or is there a better way to move a view from page 1 to page 2?

Background Color Animation

Hey there,
Im having an issue with the IFTTTColorAnimation

    var gradientBarColorAnimation: IFTTTColorAnimation!

    public override func viewDidLoad() {
        super.viewDidLoad()

        var myView = UIView(frame: CGRectMake(0, 0, 100, 100));
        myView.backgroundColor = UIColor.blackColor()
        self.view.addSubview(myView)

        self.gradientBarColorAnimation = IFTTTColorAnimation(view: myView)
        self.gradientBarColorAnimation.addKeyframeForTime(0, color: myView.backgroundColor)
        self.gradientBarColorAnimation.addKeyframeForTime(64, color: UIColor.redColor())
    }

    public func scrollViewDidScroll(scrollView: UIScrollView) {

        self.gradientBarColorAnimation.animate(scrollView.contentOffset.y)
    }

The problem is: when it pass the 64 time, it just changes the color to red, isn't an animated transition.
I tried to change the colors alpha chanel as the example uses, it doesn't work either.

Aditional info:
iOS 8.4,
Xcode 6.4
Swift 1.2

Transform square into circle

Ok, i realize this is not an issue and I'm sorry for that.
But I was wondering if it is possible to transform a square into a circle and vice versa and if so, how could I accomplish that?

Thanks in advance.

No Corner Radius Animation in Pod?

Hey there!

Curious if there is a reason why IFTTTCornerRadiusAnimation is not available in the pod?

Am I missing something there?

Thanks a ton!
Nick

Overriding scrollViewDidScroll in README.md

It think you haven't updated README.md to accommodate new changes in your library since you suggest to override

- (void)scrollViewDidScroll:(UIScrollView *)aScrollView

with the content

[self.animator animate:scrollView.contentOffset.x];

but the same thing is in your base method (and some other stuff), so you don't need to call it yourself.

Additionally you don't suggest to call superclass (which I've suggested in the pull request), what couse, interface useless, since the _isAtEnd is changed in this callback!

self.isAtEnd = (aScrollView.contentOffset.x >= IFTTTMaxContentOffsetXForScrollView(aScrollView));

If refer to that part :

"Now, to animate the view, tell the animator what time it is. For example, to tie this animation to a UIScrollView, notify the animator of time in the scroller's delegate method.

(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.animator animate:scrollView.contentOffset.x];
}
This will produce an effect where the view will be at 10,10 and sized 100x100 for scroll positions 0 to 30. Between scroll positions 30 and 60, the view will grow and move until scroll position 61, where it will be locked to 150, 10 and 200x200."

Reset Animator Animations

I added a methods to remove animatable objects form the animator, allowing to replace animations on the go.

Rotate and scale together?

It appears that I can't rotate and scale a view together.

Here's my code:

'''
-(void)configAnimations
{

IFTTTFrameAnimation *moneyanimation=[IFTTTFrameAnimation animationWithView:image];
[self.animator addAnimation:moneyanimation];
[moneyanimation addKeyFrames:@[
                               [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1) andFrame:image.frame],
                               [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1.5) andFrame:CGRectOffset(image.frame, self.view.frame.size.width/2, 0)],
                               [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2) andFrame:CGRectOffset(image.frame, self.view.frame.size.width, 0)],
                               [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2.5) andFrame:CGRectOffset(image.frame, 1.5*self.view.frame.size.width, 0)],
                               [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(3) andFrame:image2.frame]
                               ]];
IFTTTScaleAnimation *moneyScale=[IFTTTScaleAnimation animationWithView:image];
[moneyScale addKeyFrames:@[
                           [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1) andScale:1],
                           [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1.5) andScale:0.75],
                           [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2) andScale:0.5],
                           [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2.5) andScale:0.75],
                           [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(3) andScale:1],
                           ]];
[self.animator addAnimation:moneyScale];
IFTTTAngleAnimation *moneyRotate=[IFTTTAngleAnimation animationWithView:image];
[moneyRotate addKeyFrames:@[
                            [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1) andAngle:0],
                            [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(1.5) andAngle:M_PI/4],
                            [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2) andAngle:M_PI_2],
                            [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(2.5) andAngle:M_PI_4*3],
                            [IFTTTAnimationKeyFrame keyFrameWithTime:timeForPage(3) andAngle:M_PI],
                            ]];
[self.animator addAnimation:moneyRotate];

}

'''

It only rotates the view named '''image'''

Animation issue in iOS 7.0.3

Hi, I used your JazzHands to build a app guide page.
and found a little issue about position of animation issue in iOS 7.0.3 while in other version of iOS is fine.
I made a demo about how that issue appears.
here is the repo : https://github.com/lane128/WLJazzHandsDemo

here is the incorrect position after animation. (iOS 7.0.3)
image
image
here is the correct position after animation (iOS > 7.0.3)
image

Hope you can help me to solve it.
Thanks.

EXC_BAD_ACCESS when running JazzHandsDemo on arm64

I am currently receiving an exception on line 52 of IFTTTAnimationKeyFrame.m when running the example project on an iPhone 5S. I cannot replicate the issue on iPhone 4S, iPhone 5 or in any of the simulators (32 or 64 bit).

I am working around this by removing arm64 from the supported architectures in the project but will have a deeper dive into the issue over Christmas and attempt to resolve it.

Anybody else running into this?

Tom

HOW TO EXECUTE ANIMATION WITH UIVIEWCONTROLLER?

I apologize if this question seems basic to some, but I am a bit of a newbie. I have tried for hours to tweak the demo code to make the animation execute on a normal uiviewcontroller (not the scrollview that they provide). I would really appreciate any feedback. Is this possible? Thank you!

Broken hide animation!!!

Previously, I had this code:

- (void)setView:(UIView *)view hiddenAtEndOfAnimation:(BOOL)hidden atPage:(Page)page {

	IFTTTHideAnimation *hideAnimation = [[IFTTTHideAnimation alloc] initWithView:view];

	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.left andHidden:!hidden]];
	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.right - 1 andHidden:!hidden]];

	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.right andHidden:hidden]];

	[self.contentAnimator addAnimation:hideAnimation];
}

but with the latest version, this is impossible, as there is no simple init that only sets the view. Highly dissapointed.

Speed up adding keyframes

Hi,

Adding keyframes seems to regenerate the animation timeline at each new frame. I understand that to change the behaviour you would have to break the compatibility with previous versions so I propose adding a macro or something to disable the behavior, combined with a new method like commitKeyframes or createTimeline that would sort keyframes and generate the timeline. Also maybe adding an optional parameter (BOOL)commit to the addKeyFrame method on the animation base class could be also nice.

By implementing this I dropped my animation creations from 1.86s down to 0.85s on iPhone4/iOS6. Agreed, I do have a lot of animations, but still this could still be a nice improvement!

I can make a pull request if you want, but I reckon you may prefer do it yourself(ves).

Keep up the good work!

PS: if there is any other room for improvement, I would love to hear about it!

Using setFrame with IFTTT ?

I experimented with IFTTT framework to some extent. If I use setFrame for a view then that view won't be displayed in screen. How to solve this ?

What does M34 mean?

The term M34 appears in many places, for example in the demo example:

    IFTTTTransform3D *tt1 = [IFTTTTransform3D transformWithM34:0.03f];

What exactly does this mean?

Invalid frame position when using demo view controller

Hi,

I am trying out your library and I am quickly facing a strange issue. The demo project runs fine on iOS6-7-8 and iPhone 4-5-6 (even after enabling iPhone 6 screen support), though if I use the exact same code in my own app it fails. Literally the same code, except for the added #import <UIKit/UIKit.h> in the view controller header.

The exception is thrown at line 24 of the view controller class: self.view.frame = animationFrame.frame; with exception CALayer position contains NaN: [nan nan].

Here is a link to the sample project: https://github.com/dvkch/JazzHandsBug1063 .

Thanks for taking time to look into this, Stan

How to use it in AutoLayout ?

hello,

you say we use this framework , we should turn off autolayout first,

but,now,we must use auto layout,can you show me how to use this framework for auto layout?

thank U

/Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/Demo/Pods/JazzHands/JazzHands/IFTTTConstraintConstantAnimation.m:18:17: Method override for the designated initializer of the superclass '-init' not found

Using Swift 2.0 in Xcode7 I get the following warnings:

/Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/Demo/Pods/JazzHands/JazzHands/IFTTTConstraintConstantAnimation.m:18:17: Method override for the designated initializer of the superclass '-init' not found

/Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/Demo/Pods/JazzHands/JazzHands/IFTTTConstraintMultiplierAnimation.m:21:17: Method override for the designated initializer of the superclass '-init' not found

/Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/Demo/Pods/JazzHands/JazzHands/IFTTTLabelAnimation.m:17:17: Method override for the designated initializer of the superclass '-init' not found

Could you please fix that.

IFTTTAnimatedPagingScrollViewController: Delegate or callback on page scroll?

Any really simple way to get a callback when specific page is shown?

If not trivial do you think it make sense to add it on

- (void)animateCurrentFrame {
    [super animateCurrentFrame];
    if(floorf(self.pageOffset) == self.pageOffset) {
      // did scroll to page self.pageOffset
    }
}

should it be implemented directly in the lib as a method to subclass or even a delegate?

what do you think?

Tutorial

Hello guys, im a newbie in coding IOS Apps, I just want to ask how to code jazz hand without using the cocoapods. thanks. I tried whats in your tutorial but i can't get it.

How could I show UIAlertController in Onboarding Screen

Now when I presented UIAlertController in Onboarding screen made from JazzHands, the screen was freeze and no any stack trace or error or crashes. The alert was showed, but I couldn't do anything with the app (such as pressing UIAlertAction's button).

How could I do it properly ?, Thanks in advance.

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.