如何在iOS / ObjectiveC中获取TouchPoint的坐标和像素颜色

我需要在Objective-C中获得TouchPoint的Coordinates和PixelColor。 这甚至有可能吗? 如果是的话,我会对如何正确的方向或任何暗示非常感兴趣。 感谢名单!

我用鼠标点击点的颜色下的ivanzoid( 如何获得一个像素的颜色在UIView? )的UIView类别方法下的颜色 。 我在自定义视图实现中像这样使用它:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint loc = [touch locationInView:self]; self.pickedColor = [self colorOfPoint:loc]; [[NSNotificationCenter defaultCenter] postNotificationName:@"ColorPicked" object:self userInfo:nil]; } 

colorOfPoint是获取颜色的ivazoid类别中的方法,loc将包含触摸点的坐标。 我发布通知,以便我的视图控制器可以做这个颜色的东西。