88[ ![ License] ( https://img.shields.io/cocoapods/l/MapCache.svg?style=flat )] ( https://cocoapods.org/pods/MapCache )
99[ ![ Platform] ( https://img.shields.io/cocoapods/p/MapCache.svg?style=flat )] ( https://cocoapods.org/pods/MapCache )
1010
11- The missing part of MapKit: A simple way to cache data .
11+ The missing part of MapKit: A simple way to cache map tiles .
1212
1313## Example
1414
@@ -30,7 +30,7 @@ In the view controller where you have the `MKMapView` import `MapCache`
3030import MapCache
3131```
3232
33- Then wihtin the ViewController add
33+ Then within the ViewController add
3434
3535``` swift
3636
@@ -46,11 +46,14 @@ class ViewController: UIViewController {
4646
4747 ...
4848
49- // First setup the your cache
49+ // First setup the your cache
5050 let config = MapCacheConfig (withTileUrlTemplate : " https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" )
5151
52- // Tell the map to use MapCache with the config
53- map.useMapCache (withConfig : config)
52+ // initialize the cache with our config
53+ mapCache = MapCache (withConfig : config)
54+
55+ // We tell the MKMapView to use our cache
56+ map.useCache (mapCache! )
5457
5558 ...
5659}
@@ -64,9 +67,10 @@ Finally, tell the map delegate to use mapCacheRenderer
6467// add this extension:
6568extension ViewController : MKMapViewDelegate {
6669 func mapView (_ mapView : MKMapView, rendererFor overlay : MKOverlay) -> MKOverlayRenderer {
67- return mapView.mapCacheRenderer (for : overlay)
70+ return mapView.mapCacheRenderer (forOverlay : overlay)
6871 }
6972}
73+
7074```
7175
7276## Author
0 commit comments