Remove item from dictionary with key

 Problem

I have a Dictionary and want to delete an item with a specific key.



 Recipe


// Initialize the Dictionary
var dict = ["name": "John", "surname": "Doe"]
 
// Remove item with key 'name'

dict.removeValueForKey("name")
print(dict)
				


 Playground

Find answers here

Hi there! Ask Us a Question We are ready to help