mapView.rac_valuesForKeyPath("userTrackingMode", observer: self).subscribeNextAs {
// block handling
I get an error 'String' is not convertible to 'String!'
. Any suggestions what this may mean?
I used to think, that String!
is same as String
, so it is unwrapped String?
...
I think the compiler is reporting a wrong error.
You can simplify the expression using
let key: String! = "userTrackingMode"
and then use key
instead of the literal.
That will simplify the expression and will help the compiler to print the real error.
Type inferring is complicated and when the compiler doesn't find a valid type combination, it can show you a wrong error.
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