LegacyTagCollection

public final class LegacyTagCollection : Codable
extension LegacyTagCollection: CustomStringConvertible

Collection of Tag instances.

  • Contains true if the collection is empty

    Declaration

    Swift

    public var isEmpty: Bool { get }
  • Number of tags in the collection

    Declaration

    Swift

    public var count: Int { get }
  • Initialize new collection.

    Declaration

    Swift

    public init(tags: [LegacyTag] = [])

    Parameters

    tags

    collection to use

  • Obtain a list of Tag names from a set of Tag keys

    Declaration

    Swift

    public func names(of keys: Set<LegacyTag.Key>) -> [String]

    Parameters

    keys

    the keys of the Tags to include

    Return Value

    list of Tag names

  • Obtain the index in the collection for a given Tag key

    Declaration

    Swift

    public func index(of key: LegacyTag.Key) -> Int?

    Parameters

    key

    the Tag key to look for

    Return Value

    the optional index value

  • Obtain a Tag instance at the given index.

    Declaration

    Swift

    public func getBy(index: Int) -> LegacyTag

    Parameters

    index

    the collection index to get

    Return Value

    the Tag value

  • Obtain the Tag that has the given key

    Declaration

    Swift

    public func getBy(key: LegacyTag.Key) -> LegacyTag?

    Parameters

    key

    the key to look for

    Return Value

    the optional Tag that was found

  • Add a new Tag to the collection

    Declaration

    Swift

    public func append(_ tag: LegacyTag) -> Int

    Parameters

    tag

    the Tag to add

    Return Value

    the position in the collection of the tag

  • Insert a tag in a given place in the collection.

    Declaration

    Swift

    public func insert(_ tag: LegacyTag, at index: Int)

    Parameters

    tag

    the Tag to insert

    index

    the location to insert it

  • Remove a tag from the collection.

    Declaration

    Swift

    public func remove(at index: Int) -> LegacyTag

    Parameters

    index

    the location to remove

    Return Value

    the Tag that was removed

  • Rename a tag.

    Declaration

    Swift

    public func rename(_ index: Int, name: String)

    Parameters

    index

    the index of the Tag to rename

    name

    the new name to use

  • Custom description string for the tag collection

    Declaration

    Swift

    public var description: String { get }