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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -