//
//? 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];
//序列幀動(dòng)畫要播放的圖片數(shù)組
//? ? ? imageView.animationImages
//動(dòng)畫時(shí)長(zhǎng)
//? ? imageView.animationDuration
//動(dòng)畫重復(fù)次數(shù)
//? ? imageView.animationRepeatCount
//開始動(dòng)畫
//? ? [imageView startAnimating];
//結(jié)束動(dòng)畫
//? ? [imageView stopAnimating];
//是否正在執(zhí)行動(dòng)畫
//? ? [imageView isAnimating]'
}
- (IBAction)eatBirdaction:(UIButton*)sender {
NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=40*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)drinkaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=81*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)knockoutaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=81*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)Tompieaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=24*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)qiaoluoaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=13*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)Tomfartaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=28*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)scratchaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=56*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)angryaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=26*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)sromachaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=34*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)rightatcion:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=30*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (IBAction)leftaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(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è)置動(dòng)畫圖片數(shù)組
self.TomCatView.animationImages= images;
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
self.TomCatView.animationDuration=30*0.075;
//重復(fù)次數(shù)
self.TomCatView.animationRepeatCount=1;
//開始動(dòng)畫
[self.TomCatViewstartAnimating];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end