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 |
Tags
- CoreImage
- Git
- escaping
- list
- http
- Refresh
- 화면전환
- error
- array
- apns
- Switch
- viewlifecycle
- struct
- 고차함수
- SWIFTUI
- SWIFT
- 글또
- Observer
- singleton
- PushNotification
- mvvm
- uikit
- Animation
- IOS
- calendar
- segue
- self
- ScrollView
- class
- NotificationCenter
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.