Skip to content

Instantly share code, notes, and snippets.

@jeffbailey
Last active December 26, 2015 01:08
Show Gist options
  • Save jeffbailey/7068792 to your computer and use it in GitHub Desktop.
Save jeffbailey/7068792 to your computer and use it in GitHub Desktop.
UIActionSheet: Use tintColor for button titles.
// Iterate through the sub views of the action sheet
for (id actionSheetSubview in sheet.subviews) {
// Change the font color if the sub view is a UIButton
if ([actionSheetSubview isKindOfClass:[UIButton class]]) {
UIButton *button = (UIButton *)actionSheetSubview;
[button setTitleColor:self.view.tintColor forState:UIControlStateNormal];
[button setTitleColor:self.view.tintColor forState:UIControlStateSelected];
[button setTitleColor:self.view.tintColor forState:UIControlStateHighlighted];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment