Not sure I understand.
Do you need to post notification ?
If so, that will be like this
let center = UNUserNotificationCenter.current()
center.delegate = self
let requestIdentifier = "RequestID"
if value > 10 {
let content = UNMutableNotificationContent()
// Build the content
content.categoryIdentifier = "alarm"
// Then trigger the notification
UNUserNotificationCenter.current().delegate = self
self.registerCategories()
let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: TimeInterval(1), repeats: false) //set the time interval as needed
let request = UNNotificationRequest(identifier:requestIdentifier, content: content, trigger: trigger)
center.add(request) {(error) in }
}