ios - Cannot invoke "Append" with Argument list of type '(String)' -
i'm working extensions in swift, , have created extension string follows:
extension string { func reverse() -> string { let chars = array(arrayliteral: self).reverse() var reversed = "" char in chars { reversed.append(char) } return reversed } } name = "faisal syed" name.reverse()
on line says
reversed.append(char)
i error saying can't invoke "append" argument list of type string.
how work around this?
Comments
Post a Comment