GKChallengeEventHandlerDelegate

Trait GKChallengeEventHandlerDelegate 

Source
pub unsafe trait GKChallengeEventHandlerDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn localPlayerDidSelectChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    )
       where Self: Sized + Message { ... }
    unsafe fn shouldShowBannerForLocallyReceivedChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn localPlayerDidReceiveChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    )
       where Self: Sized + Message { ... }
    unsafe fn shouldShowBannerForLocallyCompletedChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn localPlayerDidCompleteChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    )
       where Self: Sized + Message { ... }
    unsafe fn shouldShowBannerForRemotelyCompletedChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn remotePlayerDidCompleteChallenge(
        &self,
        challenge: Option<&GKChallenge>,
    )
       where Self: Sized + Message { ... }
}
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallengeEventHandler only.
Expand description

GKChallengeEventHandler’s delegate must implement the following protocol to be notified of challenge-related events. All of these methods are called on the main thread.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn localPlayerDidSelectChallenge(&self, challenge: Option<&GKChallenge>)
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

Called when the user taps a challenge notification banner or the “Play Now” button for a challenge inside Game Center, causing the game to launch. Also called when the user taps a challenge banner inside the game.

§Safety

challenge might not allow None.

Source

unsafe fn shouldShowBannerForLocallyReceivedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

If the method returns YES, a challenge banner (like an achievement or welcome banner – not a notification center banner) is displayed when a challenge is received in-game for the local player. If NO, then no banner is displayed, and localPlayerDidSelectChallenge: will not be called for that challenge. Default behavior for non-implementing apps is YES.

§Safety

challenge might not allow None.

Source

unsafe fn localPlayerDidReceiveChallenge(&self, challenge: Option<&GKChallenge>)
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

Called when the local player has received a challenge, triggered by a push notification from the server. Received only while the game is running.

§Safety

challenge might not allow None.

Source

unsafe fn shouldShowBannerForLocallyCompletedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

If the method returns YES, a challenge banner (like an achievement or welcome banner – not a notification center banner) is displayed. If NO, then no banner is displayed. Default behavior for non-implementing apps is YES.

§Safety

challenge might not allow None.

Source

unsafe fn localPlayerDidCompleteChallenge( &self, challenge: Option<&GKChallenge>, )
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

Called when the local player has completed one of their challenges, triggered by a push notification from the server. Received only while the game is running.

§Safety

challenge might not allow None.

Source

unsafe fn shouldShowBannerForRemotelyCompletedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

If the method returns YES, a challenge banner (like an achievement or welcome banner – not a notification center banner) is displayed. If NO, then no banner is displayed. Default behavior for non-implementing apps is YES.

§Safety

challenge might not allow None.

Source

unsafe fn remotePlayerDidCompleteChallenge( &self, challenge: Option<&GKChallenge>, )
where Self: Sized + Message,

👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.
Available on crate feature GKChallenge only.

Called when a non-local player has completed a challenge issued by the local player. Triggered by a push notification from the server. Received when a challenge notification banner is tapped, or while the game is running.

§Safety

challenge might not allow None.

Trait Implementations§

Source§

impl ProtocolType for dyn GKChallengeEventHandlerDelegate

Source§

const NAME: &'static str = "GKChallengeEventHandlerDelegate"

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 GKChallengeEventHandlerDelegate

Implementations on Foreign Types§

Source§

impl<T> GKChallengeEventHandlerDelegate for ProtocolObject<T>

Implementors§