Created
July 28, 2015 01:26
-
-
Save koogawa/9ce42346be5a8a656da8 to your computer and use it in GitHub Desktop.
ソースコードのキャプチャ付きツイートテスト #CodePiece
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
private func buildQueryString(fromDictionary parameters: [String: String]) -> String { | |
var urlVars = [String]() | |
for (key, var val) in parameters { | |
val = val.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! | |
urlVars += [key + "=" + "\(val)"] | |
} | |
return (!urlVars.isEmpty ? "?" : "") + join("&", urlVars) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment