Created
May 1, 2017 21:53
-
-
Save andersio/33faf2fb9eddefee9bab80c1ea34ccda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ManuallyFinishingOperation: BlockOperation { | |
override var isFinished: Bool { | |
return _isFinished && super.isFinished | |
} | |
var _isFinished: Bool = false { | |
willSet { willChangeValue(forKey: "isFinished") } | |
didSet { didChangeValue(forKey: "isFinished") } | |
} | |
init(_ block: @escaping (ManuallyFinishingOperation) -> Void) { | |
super.init() | |
addExecutionBlock { block(self) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment