let say I defined a class
class Dummy {
var title: String?
}
and I have a dictionary as
let foo: [Int: String?] = [:]
then when I make an assignment as below
var dummy = Dummy()
dummy.title = foo[1]
it says
Cannot assign value of type 'String??' to type 'String?'
Insert ' as! String'
return type of foo
is String?
and Dictionary
returns optional of its value type when used subscript but what is String??
type in swift?
I think it should be legal to make such assignment. Why it complains and how should I make this assignment