Created
November 22, 2014 21:31
-
-
Save jemmons/25668e8bf2f87109746f to your computer and use it in GitHub Desktop.
`returning` for Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func returning<T>(object:T, block:(_:T)->Void)->T{ | |
block(object) | |
return object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
return returning(tableView.dequeueReusableCellWithIdentifier("Identifier")){ cell in | |
cell.textLabel.text = "Hello" | |
cell.detailTextLabel?.text = "World" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment