この物件のみを検索iOS 10+ OS物件を代用する代替ソリューションは何ですか?adjustsFontForContentSizeCategory iOSの代替手段は何ですか?
Apple documentation for Objective C
@property(nonatomic) BOOL adjustsFontForContentSizeCategory;
var adjustsFontForContentSizeCategory: Bool { get set }
我々は低いバージョンのアプリがクラッシュあるで開いたときに、このプロパティは、下位バージョンでは動作しません。下のバージョンでは
class ViewController: UIViewController {
@IBOutlet weak var dynamicTextLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
dynamicTextLabel.font = .preferredFont(forTextStyle: .body)
NotificationCenter.default.addObserver(forName: .UIContentSizeCategoryDidChange, object: nil, queue: .main) { [weak self] notification in
self?.dynamicTextLabel.font = .preferredFont(forTextStyle: .body)
}
}
deinit {
NotificationCenter.default.removeObserver(self, name: .UIContentSizeCategoryDidChange, object: nil)
}
}
plz形式の回答 –
@Prashantフォーマットに感謝します。私は逃しました。 –
@kapsym喜び。 – Prashant