Skip to content

Instantly share code, notes, and snippets.

@ddonovan
Created November 6, 2014 04:14
Show Gist options
  • Save ddonovan/bc27619cda8a8bc47cec to your computer and use it in GitHub Desktop.
Save ddonovan/bc27619cda8a8bc47cec to your computer and use it in GitHub Desktop.
Sample of how to add a glow to a UITextField, for something like active control, or error, etc.
- (void)highlightControl: (UITextField *) textField{
;
// textField.layer.cornerRadius = 5;
// textField.clipsToBounds = YES;
// textField.layer.borderWidth = 1;
// textField.layer.borderColor =[[UIColor redColor] CGColor];
textField.layer.masksToBounds = NO;
textField.layer.shadowColor = [[UIColor redColor] CGColor];
textField.layer.shadowOffset = CGSizeZero;
textField.layer.shadowRadius = 5.0f;
textField.layer.shadowOpacity = 1.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment