I've subclassed NSOperation, to perform an asynchronous operation. But I'm not clear on how I declare the operation to be finished. I overrided it as follows, but it just doesn't seem right that I should be manually calling willChangeValueForKey
and didChangeValueForKey
.
private var downloadComplete = false
override var finished: Bool {
get { return self.downloadComplete }
set {
willChangeValueForKey("isFinished")
self.downloadComplete = newValue
didChangeValueForKey("isFinished")
}
}