我有一个视图,其中包含一些(嵌套)层,它们根据对拥有视图的触摸进行自定义绘图。
鉴于
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; ……
我的视图是图层的代表,将收到一个回调以通过
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { ..
我需要获取我在 touches 方法中捕获和存储的点,并在图层的绘图中利用它们。但是,在我使用它们之前,需要将视图中捕获的坐标转换为图层坐标系。如何做到这一点?
谢谢皮特