반응형
iOS 17에서 'traitCollectionDidChange'가 deprecated 되었고,
다크모드 처리하는 방법은 다음과 같습니다.
registerForTraitChanges([UITraitUserInterfaceStyle.self]) { (self: Self, previousTraitCollection: UITraitCollection) in
if self.traitCollection.userInterfaceStyle == .light {
// 라이트모드 처리
} else {
// 다크모드 처리
}
}
반응형
'개발 > iOS' 카테고리의 다른 글
아이폰 재난 문자 끄기 (0) | 2024.12.16 |
---|---|
Mac OS 업데이트 이후 Xcode 실행 (0) | 2024.12.11 |
XCode - Unable to process request - PLA Update availabl (0) | 2024.11.17 |
휴대전화번호 포멧(000-0000-0000)으로 만들기 (0) | 2024.01.16 |
SwiftUI 에서 Background나 Foreground 진입시 처리 (0) | 2024.01.05 |
Background, Foreground 진입시 처리 (0) | 2024.01.04 |
SegmentView (0) | 2023.12.30 |
UITextField hyphen(-) 연속 입력시 en dash(–)로 변경되는것 막기 (0) | 2023.12.14 |