---
title: "CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)"
framework: imageio
role: symbol
role_heading: Function
path: "imageio/cgimagemetadatacopytagmatchingimageproperty(_:_:_:)"
---

# CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)

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

## Declaration

```swift
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 doc://com.apple.imageio/documentation/ImageIO/kCGImagePropertyExifDictionary for image properties that are part of the image’s EXIF metadata.
- `propertyName`: The name of the property. For example, specify doc://com.apple.imageio/documentation/ImageIO/kCGImagePropertyTIFFOrientation, doc://com.apple.imageio/documentation/ImageIO/kCGImagePropertyExifDateTimeOriginal, or doc://com.apple.imageio/documentation/ImageIO/kCGImagePropertyIPTCKeywords. If the specified property is unsupported by the metadata object, this function logs a warning.

## Return Value

Return Value The CGImageMetadataTag object that corresponds to the specified property, or NULL if the property wasn’t found.

## Discussion

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 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.

## See Also

### Getting the Metadata Tags

- [CGImageMetadataCopyTagWithPath(_:_:_:)](imageio/cgimagemetadatacopytagwithpath(_:_:_:).md)
- [CGImageMetadataCopyTags(_:)](imageio/cgimagemetadatacopytags(_:).md)
- [CGImageMetadataCopyStringValueWithPath(_:_:_:)](imageio/cgimagemetadatacopystringvaluewithpath(_:_:_:).md)
