When User Interface Style is changed then system call func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?)
this delegate methods
please refresh your programatic assigned colors in this methods
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if(traitCollection.userInterfaceStyle == .dark){
// set your Dark UI
} else {
// set your Light UI
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…