I confuse with
static var str = "Hello1"
var str2: StaticString = "Hello2"
What is the best case to use StaticString?
How is static and StaticString allocate memory?
static string can be known at the compile time.
let str1: String = "str1" // ok
let str2: String = "\(str1) + 1" // ok
let str3: StaticString = "\(str1)" // illegal
StaticString has to be known.
let foo: StaticString = "foo" // ok
personally, i have only seen this used when creating some sort of a signpost functionality to test performance on the instruments