rust_macios/user_notifications/
un_notification.rs1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4 foundation::NSDate,
5 object,
6 objective_c_runtime::{
7 macros::interface_impl,
8 traits::{FromId, PNSObject},
9 },
10};
11
12use super::UNNotificationRequest;
13
14object! {
15 unsafe pub struct UNNotification;
17}
18
19#[interface_impl(NSObject)]
20impl UNNotification {
21 #[property]
26 pub fn request(&self) -> UNNotificationRequest {
27 unsafe { UNNotificationRequest::from_id(msg_send![self.m_self(), request]) }
28 }
29
30 #[property]
32 pub fn date(&self) -> NSDate {
33 unsafe { NSDate::from_id(msg_send![self.m_self(), date]) }
34 }
35}