Remove most uses of AppDelegate.appDelegate on iOS.

This commit is contained in:
Brent Simmons
2025-02-01 13:28:49 -08:00
parent 2fed6d3cb3
commit 900cbabe71
10 changed files with 65 additions and 24 deletions

View File

@@ -0,0 +1,25 @@
//
// ManualRefreshNotification.swift
// NetNewsWire
//
// Created by Brent Simmons on 2/1/25.
// Copyright © 2025 Ranchero Software. All rights reserved.
//
import Foundation
extension Notification.Name {
static let userDidTriggerManualRefresh = Notification.Name("userDidTriggerManualRefresh")
}
// See UserInfoKey.errorHandler for the required ErrorHandler
struct ManualRefreshNotification {
static func post(errorHandler: @escaping ErrorHandlerBlock, sender: Any?) {
Task { @MainActor in
let userInfo = [UserInfoKey.errorHandler: errorHandler]
NotificationCenter.default.post(name: .userDidTriggerManualRefresh, object: sender, userInfo: userInfo)
}
}
}