cacao/src/user_activity.rs
Ryan McGrath bc54b49475
Ongoing push to a v0.1.
- Basic support for `AttributedString` type.
- `Debug` implementations across the board to ease debugging issues.
- Methods that take `Color` and `Font` types now accept an `AsRef` to
  make implementing less of a headache.
- Cleanup of the `utils` module.
2021-03-05 14:11:17 -08:00

23 lines
592 B
Rust

//! 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;
/// 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 {
UserActivity(unsafe {
ShareId::from_ptr(object)
})
}
}