// viewWillAppear
[self usePreferredFonts];
// 系统字体更改
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(usePreferredFonts)
name:UIContentSizeCategoryDidChangeNotification
object:nil];
// viewWillDisppear
[[NotificationCenter default] removeObserver:self
name:UIContent....
object:nil];
// usePreferredFonts
self.body.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
self.header.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
objective-c NSNotificationCenter,addObserver
最新推荐文章于 2023-06-20 14:28:28 发布