--------------- viewcontroller.m ---------------
#import "ViewController.h"
@interface viewcontroller ()
@property (weak, nonatomic) iboutlet UIButton *head;
-(ibaction) Topclick;
-(ibaction) Bottomclick;
-(ibaction) Leftclick;
-(ibaction) RightClick;
-(ibaction) Leftrotateclick;
-(ibaction) Rightrotateclick;
-(ibaction) Minusclick;
-(ibaction) Plusclick;
@end
@implementation Viewcontroller
-(ibaction) Topclick
{
CGRect frame = self. head. frame;
Frame. Origin. y -= ten;
Self. head. frame = frame;
}
-(ibaction) Bottomclick
{
CGRect frame = self. head. frame;
Frame. Origin. y + = ten;
Self. head. frame = frame;
}
-(ibaction) leftclick
{
CGRect frame = self. head. frame;
Frame. Origin. x -= ten;
Self. head. frame = frame;
}
-(ibaction) rightclick
{
CGRect frame = self. head. frame;
Frame. Origin. x + = ten;
Self. head. frame = frame;
}
-(ibaction) Leftrotateclick
{
Self.Head.Transform = Cgaffinetransformrotate( Self.Head.Transform, -M_pi_4);
}
-(ibaction) Rightrotateclick
{
Self.Head.Transform = Cgaffinetransformrotate( Self.Head.Transform, M_pi_4);
}
-(ibaction) Minusclick
{
CGRect frame = self. head. frame;
Frame. size. width = ten;
Frame. size. height = ten;
Self. head. frame = frame;
}
-(ibaction) Plusclick
{
CGRect frame = self. head. frame;
Frame. size. width + = ten;
Frame. size. height + = ten;
Self. head. frame = frame;
}
@end
3. Small item: Touch What I do!