<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@F@CGImageMetadataCopyTagMatchingImageProperty"
  },
  "title" : "CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)"
}
-->

# CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)

Searches for the specified image property and, if found, returns the corresponding tag object.

```
func CGImageMetadataCopyTagMatchingImageProperty(_ metadata: CGImageMetadata, _ dictionaryName: CFString, _ propertyName: CFString) -> CGImageMetadataTag?
```

## Parameters

`metadata`

The metadata object to search.

`dictionaryName`

The metadata subdictionary to which the image property belongs. For example, specify [`kCGImagePropertyExifDictionary`](/documentation/ImageIO/kCGImagePropertyExifDictionary) for image properties that are part of the image’s EXIF metadata.

`propertyName`

The name of the property. For example, specify [`kCGImagePropertyTIFFOrientation`](/documentation/ImageIO/kCGImagePropertyTIFFOrientation), [`kCGImagePropertyExifDateTimeOriginal`](/documentation/ImageIO/kCGImagePropertyExifDateTimeOriginal), or [`kCGImagePropertyIPTCKeywords`](/documentation/ImageIO/kCGImagePropertyIPTCKeywords). If the specified property is unsupported by the metadata object, this function logs a warning.

## Return Value

The [`CGImageMetadataTag`](/documentation/ImageIO/CGImageMetadataTag) object that corresponds to the specified property, or `NULL` if the property wasn’t found.

## Discussion

Use this function to quickly search the different metadata dictionaries for a specific tag. The returned tag object contains appropriate values for all fields, including the namespace, prefix, and XMP type.

When you request an EXIF or IPTC property, this function fills in the namespace, prefix, and XMP type information by copying information from an appropriate XMP type. For example, when you request the [`kCGImagePropertyExifDateTimeOriginal`](/documentation/ImageIO/kCGImagePropertyExifDateTimeOriginal) property, the function fills in the information using the `photoshop:DateTime` XMP tag. When this bridging occurs, property fields retain their XMP format, rather than the EXIF or IPTC format.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)