Protocols
The following protocols are available globally.
-
This protocol shall be implemented by any cache used in MapCache.
See moreSee also
Main Readme pageDeclaration
Swift
public protocol MapCacheProtocol -
RegionDownloaderDelegateprovides callbacks for monitoring the progress of a tile region download.Conform to this protocol to receive notifications about download progress, individual tile results, and lifecycle events. All methods have default empty implementations provided via a protocol extension, making each callback optional — implement only the ones you need.
Usage Example
See moreclass MyViewController: UIViewController, RegionDownloaderDelegate { func startDownload() { let downloader = RegionDownloader(forRegion: region, mapCache: cache) downloader.delegate = self downloader.start() } // Update a progress bar on percentage changes. func regionDownloader(_ downloader: RegionDownloader, didDownloadPercentage percentage: Double) { DispatchQueue.main.async { self.progressView.progress = Float(percentage / 100.0) } } // Show final counts when done. func regionDownloader(_ downloader: RegionDownloader, didFinishDownload tilesDownloaded: TileNumber) { DispatchQueue.main.async { self.label.text = "Done: \(tilesDownloaded) tiles" } } }Declaration
Swift
public protocol RegionDownloaderDelegate : AnyObject
View on GitHub
Protocols Reference