One Logo Pool Ball
CoreMedia · IOS API REFERENCE

CMTag

class · iOS 17.0+ · SDK 27.1

class CMTag

CMTag is used to label something about a resource or other media construct. A CMTag contains a category and a value to represent a particular tag that might be assigned to or associated with another resource. There is only one of each of the category and the value so any notion of "has" is about the respective singular element. CMTags carry a single value that can be carried in 64 bits. This can include data types such as signed 64-bit integers, floating point values fitting in 64 bits, up to 64 bit of flags, and other data types fitting within 64 bits. A CMTag value should not be used to carry pointers or objects. If such a reference is needed, it is okay to carry an index into an out-of-band data structure that itself has a memory reference or an object reference.

Members (15)

static · iOS 17.0+

stereoView

TypeScript
static stereoView(value: CMStereoViewComponents): CMTypedTag<CMStereoViewComponents>
Swift declaration
static func stereoView(_ value: CMStereoViewComponents) -> CMTypedTag<CMStereoViewComponents>

Initializes a CMTag instance for a stereoView tag with the specified value. - Parameters: - value: The value for the tag.

get · iOS 17.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

static · iOS 17.0+

packingType

TypeScript
static packingType(value: CMPackingType): CMTypedTag<CMPackingType>
Swift declaration
static func packingType(_ value: CMPackingType) -> CMTypedTag<CMPackingType>

Initializes a CMTag instance for a packingType tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

pixelFormat

TypeScript
static pixelFormat(value: SDKHandle): CMTypedTag<SDKHandle>
Swift declaration
static func pixelFormat(_ value: OSType) -> CMTypedTag<OSType>

Initializes a CMTag instance for a pixelFormat tag with the specified value. - Parameters: - value: The value for the tag.

init · iOS 17.0+

init

TypeScript
static init(rawCategory: SDKHandle, rawTagValue: CMTag_Value): CMTag
Swift declaration
init(rawCategory: CMTag.RawCategory, rawTagValue: CMTag.Value)

Initializes a CMTag instance with the specified category and value. - Parameters: - category: The category to use for the CMTag. - rawTagValue: The value to use for the CMTag.

get · iOS 17.0+

rawCategory

TypeScript
get rawCategory(): SDKHandle
Swift declaration
final let rawCategory: CMTag.RawCategory

The category for the tag.

get · iOS 17.0+

rawTagValue

TypeScript
get rawTagValue(): CMTag_Value
Swift declaration
final let rawTagValue: CMTag.Value

The value for the tag.

static · iOS 17.0+

mediaSubType

TypeScript
static mediaSubType(value: CMFormatDescription_MediaSubType): CMTypedTag<CMFormatDescription_MediaSubType>
Swift declaration
static func mediaSubType(_ value: CMFormatDescription.MediaSubType) -> CMTypedTag<CMFormatDescription.MediaSubType>

Initializes a CMTag instance for a mediaSubType tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

videoLayerID

TypeScript
static videoLayerID(value: number): CMTypedTag<number>
Swift declaration
static func videoLayerID(_ value: Int64) -> CMTypedTag<Int64>

Initializes a CMTag instance for a videoLayerID tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

projectionType

TypeScript
static projectionType(value: CMProjectionType): CMTypedTag<CMProjectionType>
Swift declaration
static func projectionType(_ value: CMProjectionType) -> CMTypedTag<CMProjectionType>

Initializes a CMTag instance for a projectionType tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

stereoViewInterpretation

TypeScript
static stereoViewInterpretation(value: CMStereoViewInterpretationOptions): CMTypedTag<CMStereoViewInterpretationOptions>
Swift declaration
static func stereoViewInterpretation(_ value: CMStereoViewInterpretationOptions) -> CMTypedTag<CMStereoViewInterpretationOptions>

Initializes a CMTag instance for a stereoViewInterpretation tag with the specified value. - Parameters: - value: The value for the tag.

method · iOS 17.0+

value

TypeScript
value(category: CMTypedTag_Category<number>): (number) | null
Swift declaration
func value<T>(onlyIfMatching category: CMTypedTag<T>.Category) -> T? where T : Sendable

Returns the strongly typed value for a tag if it matches the specified category. Returns nil if the category of the tag doesn't match the specified category. - Parameters: - category: The category to match.

static · iOS 17.0+

trackID

TypeScript
static trackID(value: number): CMTypedTag<number>
Swift declaration
static func trackID(_ value: CMPersistentTrackID) -> CMTypedTag<CMPersistentTrackID>

Initializes a CMTag instance for a trackID tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

channelID

TypeScript
static channelID(value: number): CMTypedTag<number>
Swift declaration
static func channelID(_ value: Int64) -> CMTypedTag<Int64>

Initializes a CMTag instance for a channelID tag with the specified value. - Parameters: - value: The value for the tag.

static · iOS 17.0+

mediaType

TypeScript
static mediaType(value: CMFormatDescription_MediaType): CMTypedTag<CMFormatDescription_MediaType>
Swift declaration
static func mediaType(_ value: CMFormatDescription.MediaType) -> CMTypedTag<CMFormatDescription.MediaType>

Initializes a CMTag instance for a mediaType tag with the specified value. - Parameters: - value: The value for the tag.

Skipped declarations

No declarations were skipped in this snapshot.

All CoreMedia types →