I have push notifications sent to the device with keys that have a value returned from Localizable.strings. The number of arguments is variable, sometimes it just needs one, sometimes it requires a few.
Normally to localise a string I would use this:
String.localizedStringWithFormat(NSLocalizedString(notification.localisedKey, comment: "a comment"), notification.localisedArguments)
However this only works if notification.localisedArguments
is a single value. If it's an array, it crashes.
The workaround in iOS 10 is to use the following code:
NSString.localizedUserNotificationString(forKey: notification.localisedKey, arguments: notification.localisedArguments)
How can I make do an equivalent for iOS 9 and lower?