mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
- Adds `Logging` protocol - Moves to Swift-style `OSLog` usage os_log to Logger os_log audit Replacment of os.log with Logging
49 lines
1.4 KiB
Swift
49 lines
1.4 KiB
Swift
//
|
|
// CloudKitRemoteNotificationOperation.swift
|
|
// Account
|
|
//
|
|
// Created by Maurice Parker on 5/2/20.
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import RSCore
|
|
|
|
class CloudKitRemoteNotificationOperation: MainThreadOperation, Logging {
|
|
|
|
// MainThreadOperation
|
|
public var isCanceled = false
|
|
public var id: Int?
|
|
public weak var operationDelegate: MainThreadOperationDelegate?
|
|
public var name: String? = "CloudKitRemoteNotificationOperation"
|
|
public var completionBlock: MainThreadOperation.MainThreadOperationCompletionBlock?
|
|
|
|
private weak var accountZone: CloudKitAccountZone?
|
|
private weak var articlesZone: CloudKitArticlesZone?
|
|
private var userInfo: [AnyHashable : Any]
|
|
|
|
init(accountZone: CloudKitAccountZone, articlesZone: CloudKitArticlesZone, userInfo: [AnyHashable : Any]) {
|
|
self.accountZone = accountZone
|
|
self.articlesZone = articlesZone
|
|
self.userInfo = userInfo
|
|
}
|
|
|
|
func run() {
|
|
guard let accountZone = accountZone, let articlesZone = articlesZone else {
|
|
self.operationDelegate?.operationDidComplete(self)
|
|
return
|
|
}
|
|
|
|
logger.debug("Processing remote notification...")
|
|
|
|
accountZone.receiveRemoteNotification(userInfo: userInfo) {
|
|
articlesZone.receiveRemoteNotification(userInfo: self.userInfo) {
|
|
self.logger.debug("Done processing remote notification.")
|
|
self.operationDelegate?.operationDidComplete(self)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|