swift - Using the Map Method to Call a Class Method -
i learning map method in swift. standard definition the map method takes function (transform), , returns array containing results of calling transform on each element in array. this makes sense. if wanted add text string each string element in array following. var stringarray = ["blue", "green", "brown", "white"] var newstringarray = stringarray.map({"\($0)color"}) this adds "color" each element. my question has proper use of map function. if use create number of objects class methods acceptable use. example if have array number of objects used create new objects, calling class function map method ok? works want make sure it's not bad practice. xmlparseddataarray!.map({article.createfloarticlewithstructure($0, inmanagedobjectcontext: self.articlecontext)}) each element in xmlparseddataarray structure defined below. struct datetitlelink { var date : nsdate? var title : string? var...