Skip to content

charleshs/CollectionExt

Repository files navigation

CollectionExt

A package to provide both extended functions and features for handling collection-based data.

Table of Contents

WeakArray

The type WeakArray behaves almost like an array, except it does not retain the elements it manages. Instead, it keeps a weak reference to each of its elements. WeakArray conforms to protocols of the collection family, including Collection, MutableCollection, BidirectionalCollection, RangeReplaceableCollection. This makes it support various kinds of methods you are already familiar with, such as map(_:), reversed(), replaceSubrange(_:with:), removeAll(where:), and more.

In the circumstances where the array may keep a large number of references to objects that have been deallocated from the memory, the method removeReferencesOfDeallocatedObject() is provided to perform a clean-up for such case.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages