//
//? ViewController.m
//? TOM
//
//? Created by lanou on 16/7/12.
//? Copyright?2016年lanou. All rights reserved.
//
#import"ViewController.h"
@interfaceViewController()
@property(weak,nonatomic)IBOutletUIImageView*TomCatView;
@end
@implementationViewController
- (void)viewDidLoad {
[superviewDidLoad];
//? ? UIImageView *imageView = [UIImageView new];
//序列幀動畫要播放的圖片數(shù)組
//? ? ? imageView.animationImages
//動畫時長
//? ? imageView.animationDuration
//動畫重復次數(shù)
//? ? imageView.animationRepeatCount
//開始動畫
//? ? [imageView startAnimating];
//結(jié)束動畫
//? ? [imageView stopAnimating];
//是否正在執(zhí)行動畫
//? ? [imageView isAnimating]'
}
- (IBAction)eatBirdaction:(UIButton*)sender {
NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <40; i++) {
//根據(jù)I來加載圖片响蕴,添加到可變數(shù)組IMAGES里面绩蜻、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"eat_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=40*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)drinkaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <81; i++) {
//根據(jù)I來加載圖片弟灼,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"drink_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=81*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)knockoutaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images冒黑,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <81; i++) {
//根據(jù)I來加載圖片田绑,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"knockout_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=81*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)Tompieaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images抡爹,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <24; i++) {
//根據(jù)I來加載圖片掩驱,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"pie_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=24*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)qiaoluoaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images冬竟,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <13; i++) {
//根據(jù)I來加載圖片欧穴,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"Cymbal_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=13*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)Tomfartaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images泵殴,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <28; i++) {
//根據(jù)I來加載圖片涮帘,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"fart_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=28*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)scratchaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images笑诅,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <56; i++) {
//根據(jù)I來加載圖片调缨,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"scratch_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=56*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)angryaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images苟鸯,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <26; i++) {
//根據(jù)I來加載圖片同蜻,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"angry_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=26*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)sromachaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images早处,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <34; i++) {
//根據(jù)I來加載圖片湾蔓,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"stomach_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=34*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)rightatcion:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images砌梆,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <30; i++) {
//根據(jù)I來加載圖片默责,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"footright_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=30*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (IBAction)leftaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images咸包,負責存放要播放的圖片數(shù)組
for(NSIntegeri =0; i <30; i++) {
//根據(jù)I來加載圖片桃序,添加到可變數(shù)組IMAGES里面、
//格式化圖片
NSString*imageName = [NSStringstringWithFormat:@"footleft_%02ld.jpg",i];
//根據(jù)格式化的圖片名加載圖片image
UIImage*image = [UIImageimageNamed:imageName];
//將圖片image添加到數(shù)組images中
[imagesaddObject:image];
}
//設(shè)置動畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動畫時長
self.TomCatView.animationDuration=30*0.075;
//重復次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動畫
[self.TomCatViewstartAnimating];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end