2020-03-16 17:10:43 +11:00
|
|
|
//! A module wrapping `NSUserActivity`.
|
|
|
|
|
|
|
|
use objc::runtime::Object;
|
|
|
|
use objc_id::ShareId;
|
|
|
|
|
2020-03-18 10:55:09 +11:00
|
|
|
use crate::foundation::id;
|
|
|
|
|
2020-03-16 17:10:43 +11:00
|
|
|
/// Represents an `NSUserActivity`, which acts as a lightweight method to capture the state of your
|
|
|
|
/// app.
|
|
|
|
pub struct UserActivity {
|
|
|
|
pub inner: ShareId<Object>
|
|
|
|
}
|
|
|
|
|
|
|
|
impl UserActivity {
|
|
|
|
/// An internal method for wrapping a system-provided activity.
|
|
|
|
pub(crate) fn with_inner(object: id) -> Self {
|
|
|
|
UserActivity {
|
|
|
|
inner: unsafe { ShareId::from_ptr(object) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|