I am trying to iterate through an array using enumerateObjectsUsingBlock to fetch data. How to use enumerateObjectsUsingBlock in Swift ? Please help me with an example.
I write the extension of CollectionType.
Any way to stop a block literal in swift
func forEach(body: ((Self.Generator.Element, Int, inout Bool) -> Void)) { var stop = false let enumerate = self.enumerate() for (index,value) in enumerate { if stop { break } body(value,index,&stop) } }