Reputation: 3789
I am following the audacity code . The following line throws error in Xcode.
let translations = [String : String]()
override init() {
super.init()
translations["heart"] = "\u{0001F496}"
translations["fish"] = "\u{E522}"
}
both translations assignment lines are throwing error "cannot assign to the result of this expression"
Can you kindly advise what is the issue with the code above?
Upvotes: 0
Views: 74
Reputation: 4016
let translations = [String : String]()
makes translations
immutable. Use var
instead.
Upvotes: 1