hy,

How can i make something that changes color when i touch it in objective c, i want the whole screen to be touchable and want to draw stuff on it with finger. 
Everywhere i touch it should change the color. 
Whats the best way to do it? I already have *touchesMoved* implemented to get the coordinates of the touch. 

> 
> 
> ```
> UITouch * touch = [touches anyObject];
> CGPoint pos = [touch locationInView: [UIApplication sharedApplication].keyWindow];
> 
> ```
> 
> 

Any example code would be nice thanks.

thank you in advance,

i have the following code but it doesnt print anything where i touch

```
-(void)setPaths:(NSMutableArray *)paths
{
    self.paths =[[NSMutableArray alloc]init];
}

-(void)setAPath:(UIBezierPath *)aPath
{
  self.aPath=[UIBezierPath bezierPath];
}

-(void) drawRect:(CGRect)rect{
    [super drawRect:rect];
    [[UIColor blackColor] set];
    for (UIBezierPath *path in paths) {
        [path stroke];
    }
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.paths addObject:self.aPath];

    //self.aPath=[UIBezierPath bezierPath];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{

    UITouch * touch = [touches anyObject];
    CGPoint pos = [touch locationInView: [UIApplication sharedApplication].keyWindow];
    [self.aPath addLineToPoint:[touch locationInView:self]];
    // [self.aPath addLineToPoint:[touch locationInView:touch]];

    NSLog(@"Position of touch: %.3f, %.3f", pos.x, pos.y);
}

@end

```