Skip to content

Instantly share code, notes, and snippets.

@rodericj
Created May 5, 2014 20:43
Show Gist options
  • Save rodericj/11546993 to your computer and use it in GitHub Desktop.
Save rodericj/11546993 to your computer and use it in GitHub Desktop.
@weakify(headerView)
RAC(headerView.textField, font) = [headerView.textField.rac_textSignal map:^id(NSString * s)
{
@strongify(headerView)
UIFont *thin = [UIFont fontWithName:FONT_THIN size:headerView.textField.font.pointSize];
UIFont *normal = [UIFont fontWithName:FONT_LIGHT size:headerView.textField.font.pointSize];
return [s length] == 0 ? thin : normal;
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment