NSPointerArray

class NSPointerArray : NSObject, NSFastEnumeration, NSCopying, NSSecureCoding

This extension adds some useful functions to NSPointerArray. https://marcosantadev.com/swift-arrays-holding-elements-weak-references/

  • Adds an object to the array.

    Declaration

    Swift

    public func add(_ object: AnyObject?)

    Parameters

    object

    Object to be added.

  • Inserts an object at a given index inside the array.

    Declaration

    Swift

    public func insert(_ object: AnyObject?, at index: Int)

    Parameters

    object

    Object to be inserted.

    index

    Index.

  • Replaces an object at a given index inside the array.

    Declaration

    Swift

    public func replace(at index: Int, with object: AnyObject?)

    Parameters

    index

    Index.

    object

    Replacing object.

  • Returns an object at index.

    Declaration

    Swift

    public func object(at index: Int) -> AnyObject?

    Parameters

    index

    Index.

    Return Value

    Returns an object at index.

  • Remove an object at a given index.

    Declaration

    Swift

    public func remove(at index: Int)

    Parameters

    index

    Index.