rust_macios/user_notifications/
un_text_input_notification_response.rs

1use objc::{msg_send, sel, sel_impl};
2use rust_macios_objective_c_runtime_proc_macros::interface_impl;
3
4use crate::{foundation::NSString, object, objective_c_runtime::traits::FromId};
5
6use super::IUNNotificationResponse;
7
8object! {
9    /// The user’s response to an actionable notification, including any custom text that the user typed or dictated.
10    unsafe pub struct UNTextInputNotificationResponse;
11}
12
13impl IUNNotificationResponse for UNTextInputNotificationResponse {}
14
15#[interface_impl(UNNotificationResponse)]
16impl UNTextInputNotificationResponse {
17    /// The text response provided by the user.
18    #[property]
19    pub fn user_text(&self) -> NSString {
20        unsafe { NSString::from_id(msg_send![self.m_self(), userText]) }
21    }
22}