Add category method to post notification on main thread.

This commit is contained in:
Brent Simmons committed 2025-11-09 11:49:20 -08:00
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)
}
}
}