UITableViewCell change font of line delete button
Can I customize the delete button's font UITableView
?
The delete button UITableViewCell
uses the system font. Therefore, if you want to change the system font in your application, just override -systemFontOfSize:(CGFloat)fontSize
:
Create a category UIFont+System
and put this code inside.m
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+ (UIFont *)systemFontOfSize:(CGFloat)fontSize {
return [UIFont fontWithName:@"NameOfYourFont" size:fontSize];
}
#pragma clang diagnostic pop
Maybe look at this question
You can use an image with the font you want and then set a button for that image. Can be problematic if you have different languages
You can use
UIButton * buttonAppearance = [UIButton appearanceWhenContainedInInstancesOfClasses:@[[YourCustomCell class]]];
[buttonAppearance setAttributedTitle: attributedString forState: UIControlStateNormal];
Note. This sets the title for all buttons in your cells. Then you can change it.