How to detect Dynamic Font size changes from iOS Settings?

前端 未结 2 1330
礼貌的吻别
礼貌的吻别 2021-02-01 01:44

Inside settings->general->text size, after changing the text size, I\'d have to exit my own app to have the sizes applied to

 [UIFont preferredFontForTextStyle:.         


        
2条回答
  •  暖寄归人
    2021-02-01 02:14

    You listen for the Size Change Notification on UIContentSizeCategory.

    Swift 3.0: NSNotification.Name.UIContentSizeCategoryDidChange

    Swift 4.0 or later: UIContentSizeCategory.didChangeNotification

提交回复
热议问题