I just converted my project to Swift 3 I have this line of code here:
let type = self.data[indexPath.row]["Type"] as? String
but now I get this error:
Type 'Any' has no subscript members
Why am I getting this error and do I fix it?
let type = (self.data[indexPath.row] as? [String : String])?["Type"]
You need to cast self.data[indexPath.row]
to a dictionary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With