I have the same animation code applied to various views in my object, so i thought I would standardise it with it’s own class. Here is the code i have:
.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface AHAnimations : NSObject
+(void)popInView:(UIView *)view;
@end
.m
#import "AHAnimations.h"
@implementation AHAnimations
+(void)popInView:(UIView *)view {
view.alpha = 0;
view.transform = CGAffineTransformMakeScale(0.9, 0.9);
[UIView animateWithDuration:0.3
delay:0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
view.alpha = 1;
view.transform = CGAffineTransformMakeScale(1, 1);
}completion:nil];
}
@end
But instead of animating, the view just appears.
Any ideas why this isn’t working?
EDIT: The original code is exactly the same. I can paste it, but other than being a different method name, i’d just be copying and pasting it from above. And now, it is simply [AHAnimations popInView:view];
// CALL This line to stop animation