mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-18 11:15:36 -05:00
Fixes #1612. ## Summary Sets the number of lines to 0, and to make the group prettier also hides the labels when empty. ## Screenshots 
21 lines
794 B
Swift
21 lines
794 B
Swift
import Foundation
|
|
import Shared
|
|
import UserNotifications
|
|
import WatchKit
|
|
|
|
class DynamicNotificationController: WKUserNotificationInterfaceController {
|
|
@IBOutlet var notificationTitleLabel: WKInterfaceLabel!
|
|
@IBOutlet var notificationSubtitleLabel: WKInterfaceLabel!
|
|
@IBOutlet var notificationAlertLabel: WKInterfaceLabel!
|
|
|
|
override func didReceive(_ notification: UNNotification) {
|
|
super.didReceive(notification)
|
|
|
|
notificationTitleLabel.setTextAndHideIfEmpty(notification.request.content.title)
|
|
notificationSubtitleLabel.setTextAndHideIfEmpty(notification.request.content.subtitle)
|
|
notificationAlertLabel.setTextAndHideIfEmpty(notification.request.content.body)
|
|
|
|
notificationActions = notification.request.content.userInfoActions
|
|
}
|
|
}
|