Skip to content

Instantly share code, notes, and snippets.

@jamiepinkham
Created November 19, 2015 18:57
Show Gist options
  • Save jamiepinkham/dd656da2c2aec737ce8e to your computer and use it in GitHub Desktop.
Save jamiepinkham/dd656da2c2aec737ce8e to your computer and use it in GitHub Desktop.
var str = "Hello, playground"
enum Transformer<T> {
typealias Transform = NSData -> T?;
}
let data = str.dataUsingEncoding(NSUTF8StringEncoding)!
let transformer = Transformer<String>.Transform { data in return String(data: data, encoding: NSUTF8StringEncoding) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment