summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-06-13 13:54:16 +0200
committerAndrej Mihajlov <and@mullvad.net>2022-06-13 15:04:21 +0200
commitf7d0b4671dfd984b1d4463591f178564b2ffdc02 (patch)
treea52db69116d9a46fa7aa9f9a5847536c81c3522f
parent5cf95401636bc08ceede485c123230036fb86b14 (diff)
downloadmullvadvpn-f7d0b4671dfd984b1d4463591f178564b2ffdc02.tar.xz
mullvadvpn-f7d0b4671dfd984b1d4463591f178564b2ffdc02.zip
Use type-safe #keyPath strings
-rw-r--r--ios/MullvadVPN/Operations/AsyncOperation.swift10
1 files changed, 5 insertions, 5 deletions
diff --git a/ios/MullvadVPN/Operations/AsyncOperation.swift b/ios/MullvadVPN/Operations/AsyncOperation.swift
index 979108e245..1ac471cf6a 100644
--- a/ios/MullvadVPN/Operations/AsyncOperation.swift
+++ b/ios/MullvadVPN/Operations/AsyncOperation.swift
@@ -220,11 +220,11 @@ class AsyncOperation: Operation {
self.dispatchQueue = dispatchQueue ?? DispatchQueue(label: "AsyncOperation.dispatchQueue")
super.init()
- addObserver(self, forKeyPath: "isReady", options: [], context: &Self.observerContext)
+ addObserver(self, forKeyPath: #keyPath(isReady), options: [], context: &Self.observerContext)
}
deinit {
- removeObserver(self, forKeyPath: "isReady", context: &Self.observerContext)
+ removeObserver(self, forKeyPath: #keyPath(isReady), context: &Self.observerContext)
}
// MARK: - KVO
@@ -252,15 +252,15 @@ class AsyncOperation: Operation {
}
@objc class func keyPathsForValuesAffectingIsReady() -> Set<String> {
- return ["state"]
+ return [#keyPath(state)]
}
@objc class func keyPathsForValuesAffectingIsExecuting() -> Set<String> {
- return ["state"]
+ return [#keyPath(state)]
}
@objc class func keyPathsForValuesAffectingIsFinished() -> Set<String> {
- return ["state"]
+ return [#keyPath(state)]
}
// MARK: - Lifecycle