Skip to content

Commit

Permalink
[OPR-129]: Override start but don't call super.
Browse files Browse the repository at this point in the history
  • Loading branch information
danthorpe committed Dec 14, 2015
1 parent b39ca76 commit 689c29e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Sources/Core/Shared/Operation.swift
Expand Up @@ -287,19 +287,20 @@ public class Operation: NSOperation {
}

// MARK: - Execution and Cancellation
/*

/// Starts the operation, correctly managing the cancelled state. Cannot be over-ridden
public override final func start() {
// Don't call super.start

// NSOperation.start() has important logic which shouldn't be bypassed
super.start()
// If the operation has been cancelled, we still need to enter the finished state
if cancelled {
if !cancelled {
main()
}
else {
// If the operation has been cancelled, we still need to enter the finished state
finish()
}
}
*/

/// Triggers execution of the operation's task, correctly managing errors and the cancelled state. Cannot be over-ridden
public override final func main() {
assert(state == .Ready, "This operation must be performed on an operation queue, current state: \(state).")
Expand Down

0 comments on commit 689c29e

Please sign in to comment.