I want to pass an optional dictionary parameter in Swift function, I tried declaring the function as
func myFunction(_ type:Int, params:Dictionary<String,Any?>?)
and also
func myFunc(_ type:Int, params:[String:Any?]?)
I get warning "Expression implicitly coerced from Any? to Any" with first declaration when I try to pass a dictionary but not with second. I need to know what is the difference between the two and why the warning. FYI, here is how I pass the dictionary in both cases:
myFunc(1, params:["key1": value1, "key2": value2])