@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);
--------------- 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 -= 10;
self.head.frame = frame;
}
- (IBAction)bottomClick
{
CGRect frame = self.head.frame;
frame.origin.y += 10;
self.head.frame = frame;
}
- (IBAction)leftClick
{
CGRect frame = self.head.frame;
frame.origin.x -= 10;
self.head.frame = frame;
}
- (IBAction)rightClick
{
CGRect frame = self.head.frame;
frame.origin.x += 10;
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 -= 10;
frame.size.height -= 10;
self.head.frame = frame;
}
- (IBAction)plusClick
{
CGRect frame = self.head.frame;
frame.size.width += 10;
frame.size.height += 10;
self.head.frame = frame;
}
@end