cacao/src/user_activity.rs

21 lines
570 B
Rust
Raw Normal View History

//! A module wrapping `NSUserActivity`.
//!
//! This is primarily used in handling app handoff between devices.
use objc::runtime::Object;
use objc_id::ShareId;
use crate::foundation::id;
2022-07-11 01:15:29 +10:00
/// Represents an `NSUserActivity`, which acts as a lightweight method to capture
/// the state of your app.
#[derive(Debug)]
pub struct UserActivity(pub ShareId<Object>);
impl UserActivity {
/// An internal method for wrapping a system-provided activity.
pub(crate) fn with_inner(object: id) -> Self {
2022-07-16 00:14:02 +10:00
UserActivity(unsafe { ShareId::from_ptr(object) })
}
}