swift - Initialzer for conditional binding must have Optional type not 'String' -
compiler throwing error "initialzer conditional binding must have optional type not 'string'"
if let classstring = string.fromcstring(class_getname(currentveiw?.dynamictype)){ }
the compiler telling you can't use if let because it's totally unnecessary. don't have optionals unwrap.if let used exclusively unwrap optionals. use:
let classstring = string(describing: type(of: currentveiw!))
Comments
Post a Comment