Merge branch 'ios-candidate' of https://github.com/brentsimmons/NetNewsWire into ios-candidate

This commit is contained in:
Maurice Parker 2019-12-31 17:06:32 -07:00
commit 0d915333e6
2 changed files with 25 additions and 21 deletions

View File

@ -35,8 +35,7 @@ class FeedlyOperation: Operation {
downloadProgress = nil
isExecutingOperation = false
isFinishedOperation = true
updateExecutingAndFinished(false, true)
}
func didFinish(_ error: Error) {
@ -58,9 +57,8 @@ class FeedlyOperation: Operation {
override func start() {
guard !isCancelled else {
isExecutingOperation = false
isFinishedOperation = true
updateExecutingAndFinished(false, true)
if downloadProgress != nil {
DispatchQueue.main.async {
self.downloadProgress = nil
@ -69,8 +67,8 @@ class FeedlyOperation: Operation {
return
}
isExecutingOperation = true
updateExecutingAndFinished(true, false)
DispatchQueue.main.async {
self.main()
}
@ -80,24 +78,30 @@ class FeedlyOperation: Operation {
return isExecutingOperation
}
private var isExecutingOperation = false {
willSet {
willChangeValue(for: \.isExecuting)
}
didSet {
didChangeValue(for: \.isExecuting)
}
}
override var isFinished: Bool {
return isFinishedOperation
}
private var isFinishedOperation = false {
willSet {
private var isExecutingOperation = false
private var isFinishedOperation = false
private func updateExecutingAndFinished(_ executing: Bool, _ finished: Bool) {
let isExecutingDidChange = executing != isExecutingOperation
let isFinishedDidChange = finished != isFinishedOperation
if isFinishedDidChange {
willChangeValue(for: \.isFinished)
}
didSet {
if isExecutingDidChange {
willChangeValue(for: \.isExecuting)
}
isExecutingOperation = executing
isFinishedOperation = finished
if isExecutingDidChange {
didChangeValue(for: \.isExecuting)
}
if isFinishedDidChange {
didChangeValue(for: \.isFinished)
}
}

View File

@ -1,7 +1,7 @@
// High Level Settings common to both the iOS application and any extensions we bundle with it
MARKETING_VERSION = 5.0
CURRENT_PROJECT_VERSION = 23
CURRENT_PROJECT_VERSION = 24
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon