Recently in firebase crashlytics we found out the following problem:
let a = "1-> %@" // Strings are located in Localized.strings, we already know them
let b = "1-> %@, 2-> %@"
let aStr = String(format: a, "hello") // Works fine
let bStr = String(format: b, "hello") // Run time error on certain machine (M1, physical device)
Looks like when passing less variadic parameters into String(format:) you get runtime crashes on M1 and physical devices.
I was wondering if there is any way to avoid these runtime errors for the strings coming from localised.strings.
The best would be to catch this on compile time. How would you face this problem?