1234567891011121314151617181920212223242526272829303132333435363738 |
- import Foundation
- import UIKit
- extension NotificationCenter {
- func postOnMainThread(name: String, object anObject: Any? = nil, userInfo aUserInfo: [AnyHashable : Any]? = nil, second: Double = 0) {
- DispatchQueue.main.asyncAfter(deadline: .now() + second) {
- NotificationCenter.default.post(name: Notification.Name.init(rawValue: name), object: anObject, userInfo: aUserInfo)
- }
- }
- }
|