Coder Social home page Coder Social logo

mysterioustrousers / mtanimation Goto Github PK

View Code? Open in Web Editor NEW
504.0 504.0 56.0 5.71 MB

Animate UIView with 25+ timing functions. (Bounce, elastic, exponential, etc.)

Home Page: http://mysterioustrousers.com/news/2013/3/25/visceral-apps-and-you

License: MIT License

Ruby 1.50% Objective-C 85.64% C 12.86%

mtanimation's People

Contributors

atomkirk avatar hoiogi avatar liggitt avatar mikeger avatar seivan avatar ushio 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

mtanimation's Issues

Zero-length duration does not execute provided completion block

Do something like:

[UIView mt_animateViews:@[someView] duration:0 timingFunction:MTTimingFunctionEaseInBack animations:^{
    someView.transform = CGAffineTransformMakeScale(2.0, 2.0);
} completion:^{
    NSLog(@"I am done");
}];

The transformation will take place but the NSLog in the completion block is not fired. Looks like L#128 in UIView+MTAnimation.m should get something like

if (completion) completion();

Opacity animation bug

Changing the opacity of views during animation causes views to flicker or change colors with unexpected behavior.

MTAnimation Cocoapod crashes in Xcode 6

Compiling a project using MTAnimation in Xcode 6 produces a bunch of errors, a lot about expected identifiers and unknown type name "NSString". I think it has something to do with Metal and QuartzCore but it's not a super pressing issue since it's in beta still.

Dose not add MTMatrixInterpolation.m file in Pods

I use MTAnimation though cocoapods

I wrote "pod 'MTAnimation', '~> 1.2.1' " in Podfile

$ pod install 

After screen shot that
2014-10-21 4 23 35

I propose to be modified that s.source_files statement in the podspec file
('MTAnimation/MTMatrixInterpolation.{h,c}' -> 'MTAnimation/MTMatrixInterpolation.{h,m}')

Appears to change titleColor black

Hey guys,
Thanks for sharing this!
If I use mt_animateWithViews on a UILabel with a white titleColor, it seems to be resetting it to black. Not hard to work around, I just reset it to white after the animation; but might be worth looking in to. This doesn't happen on the same block of code using AHEasing / UIView+EasingFunctions so I think it might be the MTAnimation category.

    [UIView mt_animateWithViews:@[view] duration:kOBJECTMOVESPD delay:delay timingFunction:kMTEaseInOutQuint animations:^{
                         view.center = CGPointMake(view.center.x,
                                                   view.center.y-1024);

                     }
                     completion:^(void){
                         view.hidden = YES;
                     }];

    if ([view isKindOfClass:[QMQuestionComponent class]]) {
        QMQuestionComponent *qc = (QMQuestionComponent*) view;
        [qc setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    }

Problem animating frame of a UIImageView

I'm attempting to animate the frame of a UIImageView with a transparent PNG inside.

When I do, it turns the whole view into a black box.

ios simulator screen shot mar 25 2014 1 49 43 pm

ios simulator screen shot mar 25 2014 1 49 46 pm

Video: http://cl.ly/2S3U3L2D1d3b/mtanimation-image-view-frame-problem.m4v

I wrote a stripped down version of this, and the problem remained.

Here is the animation code;

CGRect finalFrame = CGRectMake(self.view.frame.size.width/2-60,
                               self.view.frame.size.height/2-60,
                               120, 120);

[UIView mt_animateViews:@[_image]
               duration:1.0f
         timingFunction:kMTEaseOutBack
             animations:^{
                 _image.frame = finalFrame;
             }
             completion:nil];

Here is my sample project: http://cl.ly/3b0I2w0o222w

Am I missing something obvious here?

XCode 5.1, targeting iOS 7

Thanks for your time!

EaseInCirc Crash

Tapping EaseInCirc in the iPad simulator produced a crash.

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

Screenshot:

image

Mmmm.... naan...

image

MTAnimation and Xcode 6

Just upgraded to Xcode 6 and it's throwing out a bunch of errors related to MTAnimation.
Anyone have an idea of what's going on?

image

Contain Animation Area

This is somewhat trivial, but it may help to contain the animated block/logo to the lower gray portion of the app. Otherwise if you increase the End Scale, it covers the controls. :)

Screenshots:

image

image

Duration of length 0

I see you have asserted a duration > 0 at UIView+MTAnimation.m:114
Why is this needed?

This makes it harder to create methods which optionally animates eg.
- (void)moveBox:(BOOL)animated

Which could be implemented:
[UIView mt_animateViews:@[box] duration:animated ? 1.0f : 0.0f .......

Animate subviews

Hi!

Amazing lib, loving the custom easing for my animations.

Here is my question / enhancement request.

With [UIView animateWithDuration:animations:] the frame animations are also done on the subviews if the flag autoresizesSubviews is set to Yes and then the autoresizingMask from the children are being used to set the correct transformation of the frame.

I think that this would be very complex to implement for this lib, but just in case, I'm dropping my message here.

Best,
Arnaud

Update Cocoapods

Cocoapods shows version 0.1.5 but the repo is at 0.2.0.

Version 0.1.5 is causing some major glitches in our app, please update cocoapods!!!

Demo Project Error

I downloaded the zip and opened the project. Attempting to build on iOS 6.1 in Xcode 4.6.2, I get the following error and a failed build:

MTViewController.m line 168: No known class method for selector 'mt_animateViews:duration:timingFunction:perspective:exaggeration:animations:completion:'

image

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.