A lightweight cache component.
GXCache is a lightweight cache component. It releases the data cache in memonry when your App receives memory warning, and lazy-loading when you access your value next time.
- Thread-safe.
- Support Objective-C NSCoding and NSCopying.
- Support Swift.
GXCache will clean the cache folder when you first time cache data for each process. Write data into disk when set data into cache and observer UIApplicationDidReceiveMemonryWarningNotification
to release data in memory. Lazy-loading will work if there occurred memory warning.
You can find sample with the testcase GXCacheTests.m
Add files GXCache .h and .m
into your project manually, they are under folder sources
.
Use this component in your apps? Let me know!
Copyright (c) 2018 ChihChiang-Chiu (Green), https://medium.com/@greenchiu1986 Licensed under the MIT license.