GKNotificationBanner Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/GameKit.framework
Availability
Available in OS X v10.8 and later.
Companion guide
Declared in
GKNotificationBanner.h

Overview

The GKNotificationBanner class allows your game to display a notification banner that displays text to the player. The behavior of this banner is identical to other banners used by Game Kit.

Tasks

Displaying a Notification Banner

Class Methods

showBannerWithTitle:message:completionHandler:

Displays a banner to the player.

+ (void)showBannerWithTitle:(NSString *)title message:(NSString *)message completionHandler:(void (^)(void))completionHandler
Parameters
title

The title of the banner.

message

A secondary message to be displayed.

completionHandler

A block to be called after the score is reported.

Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Availability
  • Available in OS X v10.8 and later.
Declared In
GKNotificationBanner.h

showBannerWithTitle:message:duration:completionHandler:

Displays a banner to the player for a specified period of time.

+ (void)showBannerWithTitle:(NSString *)title message:(NSString *)message duration:(NSTimeInterval)duration completionHandler:(void (^)(void))completionHandler
Parameters
title

The title of the banner.

message

A secondary message to be displayed.

duration

The amount of time that the banner should be displayed to the player.

completionHandler

A block to be called after the score is reported.

Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Availability
  • Available in OS X v10.9 and later.
Declared In
GKNotificationBanner.h