rust_macios/contacts/
cn_change_history_add_contact_event.rs

1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4    foundation::NSString,
5    object,
6    objective_c_runtime::{macros::interface_impl, traits::FromId},
7};
8
9use super::{CNContact, ICNChangeHistoryEvent};
10
11object! {
12    ///
13    unsafe pub struct CNChangeHistoryAddContactEvent;
14}
15
16impl ICNChangeHistoryEvent for CNChangeHistoryAddContactEvent {}
17
18#[interface_impl(CNChangeHistoryEvent)]
19impl CNChangeHistoryAddContactEvent {
20    ///
21    #[property]
22    pub fn contact(&self) -> CNContact {
23        unsafe { CNContact::from_id(msg_send![self.m_self(), contact]) }
24    }
25
26    ///
27    #[property]
28    pub fn container_identifier(&self) -> NSString {
29        unsafe { NSString::from_id(msg_send![self.m_self(), containerIdentifier]) }
30    }
31}