除了浏览pdf电子书之外,如期完成了涂鸦pdf。
为了翻页手势和涂鸦手势的正确识别,还是将浏览和涂鸦分离开来的好,对不同view的处理还是少了很多麻烦滴。
主要涉及:
1. 多context,分层画画
- (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)ctx
2. 触摸事件touches族那些event
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
……3. 初始化单页view传页码
- (id)initWithFrame:(CGRect)frame onPage:(NSInteger)page
4.画轨迹方法
CG_EXTERNvoidCGPathMoveToPoint(CGMutablePathRefpath,
constCGAffineTransform*m,CGFloatx,CGFloaty)
CG_EXTERNvoidCGPathAddLineToPoint(CGMutablePathRefpath,
constCGAffineTransform*m,CGFloatx,CGFloaty)