I am trying to do something like this:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"http://google.com\"]]; request
stringByAddingPercentEscapesUsingEncoding returns a string instead of an NSData object. According to this answer, you need to use this to convert to an NSData instance:
stringByAddingPercentEscapesUsingEncoding
let data = (anySwiftString as NSString).dataUsingEncoding(NSUTF8StringEncoding)