I have a dictionary as [String:Any].Now i want to convert this dictionary keys & value as key=value&key=value.I have created below extensio
For anyone that wants the "short, short" version.
Condensed using map, you don't need the forEach or for loops. Also protocol constrained for type enforcement on the dictionary.
extension Dictionary where Key : StringProtocol, Value : StringProtocol {
var queryString: String {
self.map { "\($0)=\($1)" }.joined(separator: "&")
}
}