I have a UIActionSheet with title string \"DO: These tasks\". In the title string, the substring \"DO:\" should be Bold(with a particular font size) and the substring \"These ta
For iOS 7 the following code will work.
Implement UIActionSheetDelegate
as follows
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
[actionSheet.subviews enumerateObjectsUsingBlock:^(id _currentView, NSUInteger idx, BOOL *stop) {
if ([_currentView isKindOfClass:[UIButton class]]) {
[((UIButton *)_currentView).titleLabel setFont:[UIFont boldSystemFontOfSize:15.f]];
// OR
//[((UIButton *)_currentView).titleLabel setFont:[UIFont fontWithName:@"Exo2-SemiBold" size:17]];
}
}];
}
For iOS 6
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
for (UIView *_currentView in actionSheet.subviews) {
if ([_currentView isKindOfClass:[UILabel class]]) {
[(UILabel *)_currentView setFont:[UIFont boldSystemFontOfSize:15.f]];
// OR
//[(UILabel *)_currentView setFont:[UIFont fontWithName:@"Exo2-SemiBold" size:17]];
}
}
}