objc2-game-kit 0.3.2

Bindings to the GameKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Asynchronously shows a notification banner like the one used for Game Center’s “Welcome Back” message.
    /// If a banner is already being displayed, additional banners will be shown in sequence. Use this to notify the user of game events, high scores, completed achievements, etc.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gknotificationbanner?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use UNNotificationRequest or provide custom UI instead. This method will become a no-op in a future version of GameKit."]
    pub struct GKNotificationBanner;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GKNotificationBanner {}
);

impl GKNotificationBanner {
    extern_methods!(
        #[cfg(feature = "block2")]
        #[deprecated = "Use UNNotificationRequest or provide custom UI instead. This method will become a no-op in a future version of GameKit."]
        #[unsafe(method(showBannerWithTitle:message:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showBannerWithTitle_message_completionHandler(
            title: Option<&NSString>,
            message: Option<&NSString>,
            completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[deprecated = "Use UNNotificationRequest or provide custom UI instead. This method will become a no-op in a future version of GameKit."]
        #[unsafe(method(showBannerWithTitle:message:duration:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showBannerWithTitle_message_duration_completionHandler(
            title: Option<&NSString>,
            message: Option<&NSString>,
            duration: NSTimeInterval,
            completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl GKNotificationBanner {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}