Trait CMFallDetectionDelegate

Source
pub unsafe trait CMFallDetectionDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn fallDetectionManager_didDetectEvent_completionHandler(
        &self,
        fall_detection_manager: &CMFallDetectionManager,
        event: &CMFallDetectionEvent,
        handler: &DynBlock<dyn Fn()>,
    )
       where Self: Sized + Message { ... }
    unsafe fn fallDetectionManagerDidChangeAuthorization(
        &self,
        fall_detection_manager: &CMFallDetectionManager,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature CMFallDetectionManager only.
Expand description

CMFallDetectionDelegate

CMFallDetectionManager notifies its delegate about Fall Detection related information using this protocol

See also: CMFallDetectionManager

See also Apple’s documentation

Provided Methods§

Source

unsafe fn fallDetectionManager_didDetectEvent_completionHandler( &self, fall_detection_manager: &CMFallDetectionManager, event: &CMFallDetectionEvent, handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate features CMFallDetectionEvent and block2 only.

Update the delegate with a new Fall Detection event

Parameter handler: Apps running in the background have a finite amount of time to process Fall Detection events. Call this handler to indicate that the app has finished handling the event. The system may suspend or terminate the app before calling this block.

Fall Detection events may occur when the app is not running. Following a Fall Detection event, the system will launch the watchOS app in the background giving it small amount of background execution time. This time should be used for critical tasks related to the Fall Event. For example: placing a network request or scheduling a local notification. In order to receive Fall Detection events, create a new CMFallDetectionManager instance and set its delegate early in the watchOS app lifecycle (applicationDidFinishLaunching for example). Note that instances of WKInterfaceController may not be created when launched in the background.

If multiple Fall Detection events are generated while the app is not running, only the most recent event will be reported on the next app launch.

The same event may be reported across different app launches, always check the date of the event before processing it.

Fall Detection events can be simulated with the watchOS simulator. Use it to test the background functionality of your app.

Source

unsafe fn fallDetectionManagerDidChangeAuthorization( &self, fall_detection_manager: &CMFallDetectionManager, )
where Self: Sized + Message,

Update the delegate when the app’s Fall Detection authorization status changes

Trait Implementations§

Source§

impl ProtocolType for dyn CMFallDetectionDelegate

Source§

const NAME: &'static str = "CMFallDetectionDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn CMFallDetectionDelegate

Implementations on Foreign Types§

Source§

impl<T> CMFallDetectionDelegate for ProtocolObject<T>

Implementors§