Yes, you can use a gesture with yours UILabelto highlight text by changing the background color or your text UILabel.
UILabel NSUserDefaults , .
isLabelHighlighted BOOL UILabel.
UITapGestureRecognizer* myLabelGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(LabelClicked:)];
[myLabelView setUserInteractionEnabled:YES];
[myLabelView addGestureRecognizer:myLabelGesture];
-(void)LabelClicked:(UIGestureRecognizer*) gestureRecognizer
{
if(isLabelHighlighted)
{
myLabelView.highlightedTextColor = [UIColor greenColor];
}
else
{
myLabelView.highlightedTextColor = [UIColor redColor];
}
}
UILabel.
[[NSUserDefaults standardUserDefaults] setBool:isLabelHighlighted forKey:@"yourKey"];
, .
isLabelHighlighted = [[NSUserDefaults standardUserDefaults] boolForKey:@"yourKey"];