I'm trying to remove "songDict" from "libraryArray" but it triggers an error.
var libraryArray = UserDefaults.standard.value(forKey: "LibraryArray") as! [Dictionary<String, Any>]
var songDict = Dictionary<String, Any>()
var arr = libraryArray.filter {$0 != songDict}
And here's the error. Value of protocol type 'Any' cannot conform to 'Equatable'; only struct/enum/class types can conform to protocols
var songDict: Dictionary<String, Any>()would not compile. it should be either varsongDict: Dictionary<String, Any>(define the var and its type but no init) orvar songDict = Dictionary<String, Any>()(define var with type and init) - Scriptabledictionary(forKeyinUserDefaults. You should usevalue(forKeyonly if you know what KVC is and you really need it. - vadian