Does anyone know the complexity to initialize a struct or enum?
Or, do you know which of the 3 costs the least amount of time/resources to allocate memory for?
In my situation, I'm simply using a struct/enum to house variables for me to reference later. As an example, here's the equivalent struct/enum:
Using a struct:
struct Identifier {
static let key = "a long string as a dictionary key, shortened using struct."
}
let dictionaryItem = aDictionary[Identifier.key]
Now using enums:
enum Identifier: String {
case Key = "a long string as a dictionary key, shortened using enum."
}
let dictionaryItem = aDictionary[Identifier.Key.rawValue]
Which would be faster? Which is more effi