How do I append one Dictionary to another Dictionary using Swift?
I am using the AlamoFire library to send a
Try This Approach
let dict1: [String: AnyObject] = ["kFacebook": ["kToken": "token"]]
let dict2: [String: AnyObject] = ["kRequest": ["kTargetUserId": "userId"]]
var combinedAttributes : NSMutableDictionary!
combinedAttributes = NSMutableDictionary(dictionary: dict1)
combinedAttributes.addEntriesFromDictionary(dict2)
println(combinedAttributes)
It will Print Following :
{
kFacebook = {
kToken = token;
};
kRequest = {
kTargetUserId = userId;
};
}
Hope it helps !!