use rust_macios_objective_c_runtime_proc_macros::interface_impl;
use crate::object;
use super::IUNNotificationTrigger;
object! {
unsafe pub struct UNLocationNotificationTrigger;
}
impl IUNNotificationTrigger for UNLocationNotificationTrigger {}
#[interface_impl(UNNotificationTrigger)]
impl UNLocationNotificationTrigger {
#[method]
fn trigger_with_region_repeats(region: crate::core_location::CLRegion, repeats: bool) -> Self
where
Self: Sized + crate::objective_c_runtime::traits::FromId,
{
use objc::{msg_send, sel, sel_impl};
unsafe {
Self::from_id(msg_send![Self::m_class(), triggerWithRegion: region repeats: repeats])
}
}
#[property]
fn region(&self) -> crate::core_location::CLRegion {
use crate::objective_c_runtime::traits::FromId;
use objc::{msg_send, sel, sel_impl};
unsafe { crate::core_location::CLRegion::from_id(msg_send![self.m_self(), region]) }
}
}