ios - Swift How do I convert document file URLs to strings so I can display the file names in tableview -
currently have files in array urls:
var caffilesarray: [nsurl] { return (nsfilemanager.defaultmanager().contentsofdirectoryaturl(documentsdirectoryurl, includingpropertiesforkeys: nil, options: .skipshiddenfiles | .skipssubdirectorydescendants | .skipspackagedescendants, error: nil) as! [nsurl]).sorted{$0.lastpathcomponent<$1.lastpathcomponent}.filter{$0.pathextension!.lowercasestring == "caf"}
how convert array of urls strings can display them in tableview.
thanks.
loop through nsurl
array , myurl.absolutestring
convert each element string
, append array.
Comments
Post a Comment