use objc::{msg_send, sel, sel_impl};
use rust_macios_objective_c_runtime_proc_macros::interface_impl;
use crate::{
foundation::NSString,
object,
objective_c_runtime::traits::{FromId, PNSObject},
uikit::UIScene,
utils::to_optional,
};
use super::UNNotification;
object! {
unsafe pub struct UNNotificationResponse;
}
#[interface_impl(NSObject)]
impl UNNotificationResponse {
#[property]
pub fn action_identifier(&self) -> NSString {
unsafe { NSString::from_id(msg_send![self.m_self(), actionIdentifier]) }
}
#[property]
pub fn notification(&self) -> UNNotification {
unsafe { UNNotification::from_id(msg_send![self.m_self(), notification]) }
}
#[property]
pub fn target_scene(&self) -> Option<UIScene> {
unsafe { to_optional(msg_send![self.m_self(), targetScene]) }
}
}