Skip to content

Instantly share code, notes, and snippets.

@psobko
Created November 21, 2013 19:35
Show Gist options
  • Save psobko/7588106 to your computer and use it in GitHub Desktop.
Save psobko/7588106 to your computer and use it in GitHub Desktop.
-(void)setEmailFieldBold:(BOOL)bold animated:(BOOL)animated
{
CGFloat fontSize = self.emailTextField.font.pointSize;
void (^setBold)(void) = ^{
self.emailTextField.font = (bold) ? [UIFont QRBoldFontWithSize:fontSize]
: [UIFont QRRegularFontWithSize:fontSize];
};
if (!animated)
{
[UIView transitionWithView:self.emailTextField
duration:0.35
options:UIViewAnimationOptionTransitionCrossFade
animations:^{ setBold(); }
completion:nil];
}
else
{
setBold();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment