일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- SwiftUI
- Python
- JPA
- Code
- view
- stack
- 개발자
- window
- 한글
- darkmode
- Xcode
- IOS
- iOS16
- FLUTTER
- github
- MacOS
- appstore
- Session
- rxswift
- Realm
- Git
- Notification
- UIButton
- Apple
- Archive
- mac
- 웹뷰
- Firebase
- Swift
- error
- Today
- Total
목록UIColor (2)
EEYatHo 앱 깎는 이야기
Dynamic Color UITraitCollection 객체는 다크모드, 라이트모드에 대한 정보가 있다. UIColor 는 UITraitCollection 를 가지고, 다크모드와 라이트모드에 대응 한다. 이를 다이나믹 컬러 (Dynamic Color) 라고 한다. ( CGColor 는 다이나믹 컬러가 아니다. ) 런타임에 다크모드나 라이트모드로 바뀔시 대응하기 위해선, 다이나믹 컬러를 사용해야한다. 다이나믹 컬러를 만드는 방법은 크게 2개다. 1. AssetCatalog 로 Dynamic Color 생성하기 UIColor(named: "white_black") 2. Dynamic Color 코드로 생성하기 UIColor { traitCollection -> UIColor in if traitCollec..
UIColor -> UIImage UIGraphicsBeginImageContext(CGSize(width: 1, height: 1)) UIGraphicsGetCurrentContext()!.setFillColor(uicolor.cgColor) UIGraphicsGetCurrentContext()!.fill(CGRect(x: 0, y: 0, width: 1, height: 1)) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() UIImage + UIImage -> DynamicUIImage ( 다크모드, 라이트모드에 따라 런타임에 바뀌는 Image ) lightImage?.imageAsset?.regis..