mirror of
https://github.com/samsonjs/Advanced-NSOperations.git
synced 2026-03-25 08:25:47 +00:00
Code style
This commit is contained in:
parent
32a2bf8c29
commit
5d128c9aa1
1 changed files with 14 additions and 14 deletions
|
|
@ -127,29 +127,29 @@ class EarthquakeOperation: Operation {
|
||||||
override var isReady: Bool {
|
override var isReady: Bool {
|
||||||
switch state {
|
switch state {
|
||||||
|
|
||||||
case .Initialized:
|
case .Initialized:
|
||||||
// If the operation has been cancelled, "isReady" should return true
|
// If the operation has been cancelled, "isReady" should return true
|
||||||
return isCancelled
|
return isCancelled
|
||||||
|
|
||||||
case .Pending:
|
case .Pending:
|
||||||
// If the operation has been cancelled, "isReady" should return true
|
// If the operation has been cancelled, "isReady" should return true
|
||||||
guard !isCancelled else {
|
guard !isCancelled else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// If super isReady, conditions can be evaluated
|
// If super isReady, conditions can be evaluated
|
||||||
if super.isReady {
|
if super.isReady {
|
||||||
evaluateConditions()
|
evaluateConditions()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Until conditions have been evaluated, "isReady" returns false
|
// Until conditions have been evaluated, "isReady" returns false
|
||||||
return false
|
return false
|
||||||
|
|
||||||
case .Ready:
|
case .Ready:
|
||||||
return super.isReady || isCancelled
|
return super.isReady || isCancelled
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue