Closed 942v closed 6 years ago
Hi 942v.
This has to do with the relationships between action button styles. default
and destructive
style share a font, while cancel
has its own font. default
and cancel
share a color, while destructive
gets its own color. (this mimics the relationship between styles of UIAlertController. While the fonts and colors themselves are customizable, the relationship between them is immutable.) To change the font of a cancel style, use .cancelActionTextFont
. More information is available here.
Nice, thanks.
a similar behavior pattern is enforced with colors. This exists fo allow customization via UIAppearance. You can do assign [VSAlertAction appearance].actionTextFont
without changing the font for cancel actions. Same with the destructive color, etc.
Hi @vsanthanam
Why is it that the font for a button with style VSAlertActionStyleCancel can't be changed? You prevent that change in this 2 places:
`
(void)setActionTextFont:(UIFont *)actionTextFont {
_actionTextFont = actionTextFont;
if (self.style != VSAlertActionStyleCancel) {
}
}`
self.titleLabel.font = self.style == VSAlertActionStyleCancel ? [UIFont systemFontOfSize:17.0f weight:UIFontWeightSemibold] : _actionTextFont;