Is there a Swift version of NSMapTable
like for NSArray
(Array
), NSDictionary
(Dictionary
) and NSSet
(Set
)?
AFAIK, none exists. If that's the case, is it possible to write an implementation of NSMapTable
in pure Swift?
PS: This question is for two reasons. Firstly, I'd like to have a generic version of NSMapTable
. Secondly, I'm curious to know if Swift has the tools needed for implementing a collection that stores weak values and removes them automatically when the values become nil.