TakingTom

view.h

#import <UIKit/UIKit.h>




@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

- (IBAction)rightListenBtn:(id)sender;
- (IBAction)AngryBtn:(id)sender;
- (IBAction)drinkBtn:(id)sender;
- (IBAction)eatBtn:(id)sender;
- (IBAction)fartBtn:(id)sender;
- (IBAction)footRightBtn:(id)sender;

- (IBAction)footLeftBtn:(id)sender;
- (IBAction)happyBtn:(id)sender;
- (IBAction)knockoutBtn:(id)sender;
- (IBAction)pieBtn:(id)sender;
- (IBAction)scratchBtn:(id)sender;
- (IBAction)sneezeBtn:(id)sender;
- (IBAction)stomachBtn:(id)sender;
- (IBAction)zehBtn:(id)sender;
- (IBAction)talkBtn:(id)sender;


@end

view.m

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)rightListenBtn:(id)sender {
    NSMutableArray *arry=[[NSMutableArray alloc]init];
    for (int i=0; i<12; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_listen00%d",i];
        [arry addObject:[UIImage imageNamed:image]];
        
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=arry;
    [self.imageView startAnimating];
    
}

- (IBAction)AngryBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_angry000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<26; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_angry00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)drinkBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_drink000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<81; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_drink00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
        
    }
    self.imageView.animationImages=ary;
    self.imageView.animationDuration=4;
    [self.imageView startAnimating];
}

- (IBAction)eatBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_eat000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<40; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_eat00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)fartBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_fart000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<28 ; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_fart00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationImages=ary;
    self.imageView.animationDuration=3;
    [self.imageView startAnimating];
}

- (IBAction)footRightBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_foot_right000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<30; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_foot_right00%d",i];
        [ary addObject:[UIImage imageNamed:image]];

    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)footLeftBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_foot_left000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<30; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_foot_left00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)happyBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_happy000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<29; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_happy00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)knockoutBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_knockout000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<81; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_knockout00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)pieBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_pie000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<23; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_pie00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)scratchBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_scratch000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<56; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_scratch00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)sneezeBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_sneeze000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<14; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_sneeze00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)stomachBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_stomach000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<34; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_stomach00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)zehBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_zeh000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<30; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_zeh00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}

- (IBAction)talkBtn:(id)sender {
    NSMutableArray *ary=[[NSMutableArray alloc]init];
    for (int i=0; i<10; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_talk000%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    for (int i=10; i<16; i++) {
        NSString *image=[NSString stringWithFormat:@"cat_talk00%d",i];
        [ary addObject:[UIImage imageNamed:image]];
    }
    self.imageView.animationDuration=3;
    self.imageView.animationImages=ary;
    [self.imageView startAnimating];
}
@end
Previous
Next Post »