Polish folder related methods

This commit is contained in:
Bob Sun 2017-04-26 20:28:15 -07:00
parent a499be7628
commit dd254b21d9
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
4 changed files with 66 additions and 39 deletions

View file

@ -238,3 +238,12 @@ extension FileManager {
return accumulatedSize
}
}
extension String {
func stringByAddingPercentEncodingForRFC3986() -> String? {
let unreserved = "-._~/?"
var allowed = CharacterSet.alphanumerics
allowed.insert(charactersIn: unreserved)
return addingPercentEncoding(withAllowedCharacters: allowed)
}
}