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 { ... }
}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§
Sourceunsafe fn localPlayerDidSelectChallenge(&self, challenge: Option<&GKChallenge>)
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn localPlayerDidSelectChallenge(&self, challenge: Option<&GKChallenge>)
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.
Sourceunsafe fn shouldShowBannerForLocallyReceivedChallenge(
&self,
challenge: Option<&GKChallenge>,
) -> bool
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn shouldShowBannerForLocallyReceivedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
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.
Sourceunsafe fn localPlayerDidReceiveChallenge(&self, challenge: Option<&GKChallenge>)
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn localPlayerDidReceiveChallenge(&self, challenge: Option<&GKChallenge>)
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.
Sourceunsafe fn shouldShowBannerForLocallyCompletedChallenge(
&self,
challenge: Option<&GKChallenge>,
) -> bool
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn shouldShowBannerForLocallyCompletedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
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.
Sourceunsafe fn localPlayerDidCompleteChallenge(
&self,
challenge: Option<&GKChallenge>,
)
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn localPlayerDidCompleteChallenge( &self, challenge: Option<&GKChallenge>, )
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.
Sourceunsafe fn shouldShowBannerForRemotelyCompletedChallenge(
&self,
challenge: Option<&GKChallenge>,
) -> bool
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn shouldShowBannerForRemotelyCompletedChallenge( &self, challenge: Option<&GKChallenge>, ) -> bool
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.
Sourceunsafe fn remotePlayerDidCompleteChallenge(
&self,
challenge: Option<&GKChallenge>,
)
👎Deprecated: You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.Available on crate feature GKChallenge only.
unsafe fn remotePlayerDidCompleteChallenge( &self, challenge: Option<&GKChallenge>, )
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.