<!--
{
  "availability" : [
    "iOS: 5.0.0 - 17.0.0",
    "iPadOS: 5.0.0 - 17.0.0",
    "macCatalyst: 13.1.0 - 17.0.0",
    "macOS: 10.8.0 - 14.0.0",
    "tvOS: 9.0.0 - 16.1.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKNotificationBanner",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKNotificationBanner"
  },
  "title" : "GKNotificationBanner"
}
-->

# GKNotificationBanner

A Game Center-style banner that displays a message to the local player.

```
class GKNotificationBanner
```

## Overview

This class displays a message in a banner to the local player, similar to the banner that GameKit displays when a player earns an achievement. If the game is in the foreground, the banner appears immediately. If the game is in the background, the banner appears when the game becomes active.

To display the banner with your message, use the [`show(withTitle:message:completionHandler:)`](/documentation/GameKit/GKNotificationBanner/show(withTitle:message:completionHandler:)) method. To specify a duration that GameKit presents the banner, use the [`show(withTitle:message:duration:completionHandler:)`](/documentation/GameKit/GKNotificationBanner/show(withTitle:message:duration:completionHandler:)) method instead. Optionally, pass these methods a completion handler that GameKit calls after it dismisses the banner.

```swift
GKNotificationBanner.show(withTitle:"Hooray",
                          message:"You passed level 1 and can move to level 2.",
                          completionHandler: nil)
```

## Topics

### Displaying the Banner

[`+  showBannerWithTitle:message:completionHandler:`](/documentation/GameKit/GKNotificationBanner/show(withTitle:message:completionHandler:))

Displays a banner with a title and message to the player.

[`+  showBannerWithTitle:message:duration:completionHandler:`](/documentation/GameKit/GKNotificationBanner/show(withTitle:message:duration:completionHandler:))

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

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)