Search code examples
skmaps

Request downloads late delegation


Alright,

so I have a table view, whose cells will start a offline maps download once they are tapped like so:

let map: SKTDownloadObjectHelper =  SKTDownloadObjectHelper.downloadObjectHelperWithSKTPackage(package) as! SKTDownloadObjectHelper
SKTDownloadManager.sharedInstance().requestDownloads([map], startAutomatically: true, withDelegate: self, withDataSource: self)

I define the current table view controller as the delegate for the download request. I have all the SKTDownloadManagerDelegatemethods implemented so, updating on the progress works just fine. However, if I go back one step in my table view hierarchy, obviously my table view controller gets thrown off the stack and thus my delegate.

So my question is simple: How can I, once I reenter the view where my download progress is shown, "re wire" my download to my controller?


Solution

  • it's Friday... Please forgive me. Obviously it's in SKTDownloadManager. I looked in every other class definition, but this one.

    SKTDownloadManager.sharedInstance().downloadDelegate = self