Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- self
- IOS
- array
- singleton
- CoreImage
- NotificationCenter
- Git
- 고차함수
- ScrollView
- class
- list
- mvvm
- uikit
- error
- Switch
- viewlifecycle
- Observer
- calendar
- Animation
- segue
- SWIFT
- PushNotification
- 글또
- struct
- escaping
- SWIFTUI
- Refresh
- http
- apns
- 화면전환
Archives
- Today
- Total
목록NSCache (1)
seong_hye, the developer
Swift) NSCache에 대해 알아보기
📘 Swift - NSCache이미지를 활용하다보면 메모리가 걱정되게 되는데 이때 사용하게 되는 NSCache에 대해 알아보자 🔹NSCache란? key - value 형태의 메모리 캐시를 쉽게 구현할 수 있도록 제공되는 클래스주로 이미지나 계산 비용이 큰 데이터를 임시로 저장하고 자동으로 제거하여 성능 개선.여러 스레드에서 동시에 접근해도 안전(Thread - safe)🔹기본 사용 예제let cache = NSCache()// 캐시에 저장cache.setObject(image, forKey: "example" as NSString)//캐시에서 가져오기if let cachedImage = cache.object(forKey: "example") { imageView.image = cachedImag..
IOS
2022. 10. 3.