1 #import "ViewController.h"
2 #import "SecondVC.h"
3
4
5 #define WIDTH [UIScreen mainScreen].bounds.size.width
6 #define HEIGHT [UIScreen mainScreen].bounds.size.height
7
8 @interfaceViewController ()9 {10 UIImageView *_canvasView;//画布
11 CGPoint _startPoint;//记录开始坐标
12
13 }14 @end
15
16 @implementationViewController17
18 - (void)viewDidLoad {19 [super viewDidLoad];20
21 _canvasView =[[UIImageView alloc] initWithFrame:self.view.bounds];22 [self.view addSubview:_canvasView];23
24 UIButton *clearBtn =[UIButton buttonWithType:UIButtonTypeCustom];25 clearBtn.frame = CGRectMake(50, 20, 100, 30);26 [clearBtn addTarget:self action:@selector(clearBtnClick) forControlEvents:UIControlEventTouchUpInside];27 [clearBtn setTitle:@"清空"forState:UIControlStateNormal];28 clearBtn.