I know this might have been answered before, but I couldn\'t find anything when i searched.
So i have a dictionary that looks like this:
var dict = [Stri
If you want to remove specific element, you could do this:
var dict = ["Furniture": ["Table", "Chair", "Bed"], "Food": ["Pancakes"]]
extension Array where Element: Equatable {
mutating func removeElement(element: Element) {
if let index = indexOf ({ $0 == element }) {
removeAtIndex(index)
}
}
}
dict["Furniture"]?.removeElement("Chair") //["Furniture": ["Table", "Bed"], "Food": ["Pancakes"]]