rust_macios/user_notifications/
un_location_notification_trigger.rs1use rust_macios_objective_c_runtime_proc_macros::interface_impl;
2
3use crate::object;
4
5use super::IUNNotificationTrigger;
6
7object! {
8 unsafe pub struct UNLocationNotificationTrigger;
10}
11
12impl IUNNotificationTrigger for UNLocationNotificationTrigger {}
13
14#[interface_impl(UNNotificationTrigger)]
15impl UNLocationNotificationTrigger {
16 #[method]
23 fn trigger_with_region_repeats(region: crate::core_location::CLRegion, repeats: bool) -> Self
24 where
25 Self: Sized + crate::objective_c_runtime::traits::FromId,
26 {
27 use objc::{msg_send, sel, sel_impl};
28
29 unsafe {
30 Self::from_id(msg_send![Self::m_class(), triggerWithRegion: region repeats: repeats])
31 }
32 }
33
34 #[property]
38 fn region(&self) -> crate::core_location::CLRegion {
39 use crate::objective_c_runtime::traits::FromId;
40 use objc::{msg_send, sel, sel_impl};
41
42 unsafe { crate::core_location::CLRegion::from_id(msg_send![self.m_self(), region]) }
43 }
44}