I am pretty sure that this is the reason why my completion block is not called here:
resourceRequest = NSBundleResourceRequest(tags: Set(["preview"]))
resourceRequest?.beginAccessingResources { [weak self] downloaded in //not called
// here I do what I need with this and at the end I call
// self?.resourceRequest?.endAccessingResources()
}
I have cleaned and restarted Xcode, restarted iPhone and Macbook also. Nothing helped. How can I clear it here?
EDIT
I have printed some info of progress property:
print(resourceRequest?.progress.isCancelled) //false
print(resourceRequest?.progress.isPaused) //false
print(resourceRequest?.progress.isFinished) //false
print(resourceRequest?.progress.isIndeterminate) //false
print(resourceRequest?.progress.localizedDescription) //0% completed
print(resourceRequest?.progress.isCancellable) //true
but when I call cancel()
nothing changes...
How can I reject, cancel or resume that request?
When I print progress then I have:
<NSProgress: 0x280cd1720> : Parent: 0x0 (portion: 0) / Fraction completed: 0.0000 / Completed: 0 of 1