Created
July 16, 2013 11:52
-
-
Save mani95lisa/6008051 to your computer and use it in GitHub Desktop.
get the color of a pixel in an UIView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment