일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Git
- 웹뷰
- FLUTTER
- 개발자
- JPA
- 한글
- IOS
- appstore
- stack
- error
- view
- github
- MacOS
- Python
- Xcode
- Realm
- UIButton
- Code
- darkmode
- iOS16
- Swift
- Archive
- window
- Firebase
- mac
- Notification
- Session
- rxswift
- SwiftUI
- Apple
- Today
- Total
목록IMAGE (3)
EEYatHo 앱 깎는 이야기
Dynamic Image 런타임에서 다크모드, 라이트모드 변경에 대응하는 다이나믹 이미지 ( Dynamic Image ) 가 있다. ( Dynamic Color 처럼 ) 다이나믹 이미지는 AssetCatalog 나 Code 로 생성할 수 있다. 1. AssetCatalog 로 Dynamic Image 생성하기 UIImage(named: "MyImageName") 2. Code 로 Dynamic Color 생성하기 UIImage 에게 추가 작업 ( resize 등 ) 을 하게되면, 코드로 생성하는게 필요해진다. func dynamicImage(lightImage: UIImage, darkImage: UIImage) -> UIImage { let darkTC = UITraitCollection(traitsF..
줄바꿈을 어떻게 구현해야할지 고려하지 않고 손쉽게 이미지를 텍스트 옆에 넣을 수 있다. attributedString 에 이미지를 넣는 것이다. 구현 ( with extension ) extension NSMutableAttributedString { func appendImage(image: UIImage, bounds: CGRect) { let imageAttachment = NSTextAttachment() imageAttachment.image = image imageAttachment.bounds = bounds self.append(NSAttributedString(attachment: imageAttachment)) } func insertImage(image: UIImage, bounds:..
UIImageView 이미지 다운로드 구현 Placeholder Image 지원 Image 넣는 부분은 main queue로 작업 외부 라이브러리 없이 URLSesstion dataTask 사용 extension UIImageView { func imageDown(urlStr: String, placeholderImage: UIImage? = nil) { func _setImage(image: UIImage?) { DispatchQueue.main.async { [weak self] in self?.image = image } } // 캐싱 체크 if let image = ImageCacheManager.shared.getImage(urlStr) { _setImage(image: image) return..