use objc::{msg_send, sel, sel_impl};
use crate::{object,
foundation::NSString,
objective_c_runtime::{
macros::{interface_impl},
traits::{FromId, PNSObject},
},
};
use super::CNContact;
object! {
unsafe pub struct CNContactProperty;
}
#[interface_impl(NSObject)]
impl CNContactProperty {
#[property]
pub fn contact(&self) -> CNContact {
unsafe { CNContact::from_id(msg_send![self.m_self(), contact]) }
}
#[property]
pub fn key(&self) -> NSString {
unsafe { NSString::from_id(msg_send![self.m_self(), key]) }
}
#[property]
pub fn value(&self) -> NSString {
unsafe { NSString::from_id(msg_send![self.m_self(), value]) }
}
#[property]
pub fn label(&self) -> NSString {
unsafe { NSString::from_id(msg_send![self.m_self(), label]) }
}
#[property]
pub fn identifier(&self) -> NSString {
unsafe { NSString::from_id(msg_send![self.m_self(), identifier]) }
}
}