yandexmobile / yandexmapkit-ios

Yandex Map Kit for iOS
Other
173 stars 30 forks source link

YMKMapView cache size #185

Closed cooler333 closed 4 years ago

cooler333 commented 8 years ago

App documents & data folder tooo huge.

Please add cache control system like in Kingfisher

e.g:

        let cache = KingfisherManager.sharedManager.cache
        // Set max disk cache to 150 mb. Default is no limit.
        cache.maxDiskCacheSize = 150 * 1024 * 1024

        // Set max disk cache to duration to 5 days, Default is 1 week.
        cache.maxCachePeriodInSecond = 60 * 60 * 24 * 5
cooler333 commented 8 years ago

now it's look like this

        var error: NSError? = nil
        let cacheSize = YMKMapView.calculateCacheSize(&error)
        if error != nil {
            print(error)
        } else {
            print(cacheSize)
            // Set maps max disk cache to 100 mb.
            if cacheSize > 100_000_000 {
                YMKMapView.clearCache()
            }
        }