mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove most uses of AppDelegate.appDelegate on iOS.
This commit is contained in:
25
iOS/ManualRefreshNotification.swift
Normal file
25
iOS/ManualRefreshNotification.swift
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user