Tags

public protocol Tags : AnyObject

Protocol for activity involving sound font tags.

  • True if the tags collection has been restored

    Declaration

    Swift

    var restored: Bool { get }
  • True if there are no tags in the collection

    Declaration

    Swift

    var isEmpty: Bool { get }
  • The number of tags in the collection

    Declaration

    Swift

    var count: Int { get }
  • Obtain the names of tags in the given collection.

    Declaration

    Swift

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

    Parameters

    keys

    the collection to work with

    Return Value

    list of strings

  • Get the index for the given tag.

    Declaration

    Swift

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

    Parameters

    of

    the tag to search for

    Return Value

    the option index of the tag

  • Get the tag at a given index.

    Declaration

    Swift

    func getBy(index: Int) -> LegacyTag

    Parameters

    index

    the index to fetch

  • Get the tag by its key.

    Declaration

    Swift

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

    Parameters

    key

    the key of the tag to get

    Return Value

    tag with the given key

  • Add a tag to the collection.

    Declaration

    Swift

    func append(_ tag: LegacyTag) -> Int

    Parameters

    tag

    the tag to add

    Return Value

    index of the new tag

  • Remove the tag at the given index.

    Declaration

    Swift

    @discardableResult
    func remove(at index: Int) -> LegacyTag

    Parameters

    index

    the index to remove

    Return Value

    tag that was removed

  • Rename a tag.

    Declaration

    Swift

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

    Parameters

    index

    the index of the tag to rename

    name

    the new name to use

  • Insert a tag at the given index

    Declaration

    Swift

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

    Parameters

    tag

    the tag to insert

    index

    the location to insert it

  • Obtain the set of tags that correspond to a set of indices.

    Declaration

    Swift

    func keySet(of indices: Set<Int>) -> Set<LegacyTag.Key>

    Parameters

    indices

    the indices to fetch

    Return Value

    set of tags

  • Allow subscriptions for tag collection changes.

    Declaration

    Swift

    @discardableResult
    func subscribe<O: AnyObject>(_ subscriber: O, notifier: @escaping (TagsEvent) -> Void)
      -> SubscriberToken

    Parameters

    subscriber

    the object that is subscribing

    notifier

    the function or closure to invoke when an even takes place

    Return Value

    token that identifies the subscription and can be used to unsubscribe

  • Undocumented

    Declaration

    Swift

    func validate()