mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 01:10:38 +00:00
Add category method to post notification on main thread.
This commit is contained in:
1 parent
bea0c8e727
commit
3d8b0915db
1 file changed
+17
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// NotificationCenter+RSCore.swift
|
||||
// RSCore
|
||||
//
|
||||
// Created by Brent Simmons on 11/9/25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public extension NotificationCenter {
|
||||
|
||||
func postOnMainThread(name: Notification.Name, object: Any?, userInfo: [AnyHashable : Any]? = nil) {
|
||||
Task { @MainActor in
|
||||
NotificationCenter.default.post(name: name, object: object, userInfo: userInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user