Instance Method

setLocalizableMessageWithKey(_:arguments:)

Allows the developer to display a message at the end of a turn or match.

Declaration

func setLocalizableMessageWithKey(_ key: String, arguments: [String]?)

Parameters

key

The location of the alert message string in the Localizable.strings file for the current localization.

arguments

An array of NSString objects to be substituted using the format string.

Discussion

Only the current player is able to set this message. The message sent is localized on the receiver side if the game is installed and on the sender side otherwise. The localized message identified through the key parameter can be formatted with the %@ and %n$@ specifiers. These specifiers use the objects designated in the arguments array.

The localized message is evaluated locally from these keys and is sent as well so that devices that do not have the game installed will see the message in the sender’s localization.