------------- viewcontroller.m -------------
#import "ViewController.h"
@interface viewcontroller ()
@property (weak, nonatomic) iboutlet uiimageview *imageview;
-(ibaction) drink;
-(ibaction) konckout;
-(ibaction) footleft;
@end
@implementation Viewcontroller
-(ibaction) drink
{
[ Self Playanimationwithimagename: Span style= "font-variant-ligatures:no-common-ligatures; Color: #d12f1b ">@" Drink " andimagecount: 81 ";
}
-(ibaction) konckout
{
[ Self Playanimationwithimagename: Span style= "font-variant-ligatures:no-common-ligatures; Color: #d12f1b ">@" Knockout " andimagecount: 81 ";
}
-(ibaction) footleft
{
[ Self Playanimationwithimagename: Span style= "font-variant-ligatures:no-common-ligatures; Color: #d12f1b ">@" Footleft " andimagecount: 30 ";
}
-(void) Playanimationwithimagename: (nsstring *) imageName andimagecount: (nsinteger) Count
{
if(self. ImageView . Isanimating)
{
return;
}
nsmutablearray *images = [nsmutablearray array];
for (int i = 0; i < count; i++)
{
nsstring *name = [nsstring stringwithformat:@ "%@_%02d", Imagename,i];
UIImage *image = [UIImage imagenamed: name];
[Images AddObject: image];
}
Self. ImageView. animationimages = images;
self . imageview . animationduration = 0.05 * count;
Self . imageview Animationrepeatcount = 1 ;
[self. ImageView startanimating];
}
@end
16. Small item: Tom Cat version 2.0