15.小项目:汤姆猫 版本1.0

-------------  ViewController.m  -------------

#import "ViewController.h"

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *imageView;

- (IBAction)drink;

- (IBAction)konckOut;

- (IBAction)footLeft;

@end

@implementation ViewController

- (IBAction)drink

{

if(self.imageView.isAnimating)

{

return;

}

NSMutableArray *images = [NSMutableArray array];

for (int i = 0; i < 81; i++)

{

NSString *imageName = [NSString stringWithFormat:@"drink_%02d", i];

UIImage *image = [UIImage imageNamed:imageName];

[images addObject:image];

}

self.imageView.animationImages = images;

self.imageView.animationDuration = 0.05 * 81;

self.imageView.animationRepeatCount = 1;

[self.imageView startAnimating];

}

- (IBAction)konckOut

{

if(self.imageView.isAnimating)

{

return;

}

NSMutableArray *images = [NSMutableArray array];

for (int i = 0; i < 81; i++)

{

NSString *imageName = [NSString stringWithFormat:@"knockout_%02d", i];

UIImage *image = [UIImage imageNamed:imageName];

[images addObject:image];

}

self.imageView.animationImages = images;

self.imageView.animationDuration = 0.05 * 81;

self.imageView.animationRepeatCount = 1;

[self.imageView startAnimating];

}

- (IBAction)footLeft

{

if(self.imageView.isAnimating)

{

return;

}

NSMutableArray *images = [NSMutableArray array];

for (int i = 0; i < 30; i++)

{

NSString *imageName = [NSString stringWithFormat:@"footLeft_%02d", i];

UIImage *image = [UIImage imageNamed:imageName];

[images addObject:image];

}

self.imageView.animationImages = images;

self.imageView.animationDuration = 0.05 * 30;

self.imageView.animationRepeatCount = 1;

[self.imageView startAnimating];

}

@end

时间: 2024-10-10 10:52:47

15.小项目:汤姆猫 版本1.0的相关文章

16.小项目:汤姆猫 版本2.0

-------------  ViewController.m  ------------- #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UIImageView *imageView; - (IBAction)drink; - (IBAction)konckOut; - (IBAction)footLeft; @end @implementati

17.小项目:汤姆猫 版本3.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); -------------  ViewController.m  ------------- #import "ViewController.h" @interface ViewController () @property (weak, nonat

24.小项目:应用市场 版本7.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ------------- CZapp.h ------------- #import <Foundation/Foundation.h> @interface CZApp : NSObject @property (nonatomic,copy) NSSt

22.小项目:应用市场 版本5.0

------------- CZapp.h ------------- #import <Foundation/Foundation.h> @interface CZApp : NSObject @property (nonatomic,copy) NSString *name; @property (nonatomic,copy) NSString *icon; - (instancetype) initWithDict:(NSDictionary *) dict; + (instancet

25.小项目:应用市场 版本8.0

------------- CZapp.h ------------- #import <Foundation/Foundation.h> @interface CZApp : NSObject @property (nonatomic,copy) NSString *name; @property (nonatomic,copy) NSString *icon; - (instancetype) initWithDict:(NSDictionary *) dict; + (instancet

26.小项目:应用市场 版本9.0

------------- CZapp.h ------------- #import <Foundation/Foundation.h> @interface CZApp : NSObject @property (nonatomic,copy) NSString *name; @property (nonatomic,copy) NSString *icon; - (instancetype) initWithDict:(NSDictionary *) dict; + (instancet

23.小项目:应用市场 版本6.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ------------- C

13.小项目:图片浏览器 版本3.0

---------------  ViewController.m  --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UILabel *indexLabel; @property (weak, nonatomic) IBOutlet UII

12.小项目:图片浏览器 版本3.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ---------------  ViewController.m  --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interf