반응형

iOS 17에서 'traitCollectionDidChange'가 deprecated 되었고,

다크모드 처리하는 방법은 다음과 같습니다.

registerForTraitChange([UITraitUserInterfaceStyle.self]) { (self: Self, previousTraitCollection: UITraitCollection) in
    if self.traitCollection.userInterfaceStyle == .light {
       // 라이트모드 처리
    } else {
       // 다크모드 처리 
    }
}
반응형
Posted by 까칠코더
,