---
title: "CGImageSourceSetAllowableTypes(_:)"
framework: imageio
role: symbol
role_heading: Function
path: "imageio/cgimagesourcesetallowabletypes(_:)"
---

# CGImageSourceSetAllowableTypes(_:)

Restricts which image formats can be decoded in the current process.

## Declaration

```swift
func CGImageSourceSetAllowableTypes(_ allowableTypes: CFArray) -> OSStatus
```

## Parameters

- `allowableTypes`: A doc://com.apple.documentation/documentation/CoreFoundation/CFArray containing doc://com.apple.documentation/documentation/CoreFoundation/CFString Uniform Type Identifiers (UTIs) of allowed image formats.

## Discussion

Discussion When this method has been called, ImageIO will only decode images whose format matches one of the entries in the allow list for the remaining lifetime of the process. If per-asset format restrictions are set via kCGImageSourceAllowableTypes, only formats allowed by both mechanisms are permitted. If allowableTypes is empty, all image parsing is disabled. Unknown format identifiers are ignored. Can only be called once per process; subsequent calls are ignored. See also System-declared uniform type identifiers.

## See Also

### Functions

- [CGImageDestinationAddImageAndMetadata(_:_:_:_:)](imageio/cgimagedestinationaddimageandmetadata(_:_:_:_:).md)
- [CGImageDestinationCopyImageSource(_:_:_:_:)](imageio/cgimagedestinationcopyimagesource(_:_:_:_:).md)
- [CGImageSourceCopyMetadataAtIndex(_:_:_:)](imageio/cgimagesourcecopymetadataatindex(_:_:_:).md)
- [CGImageSourceRemoveCacheAtIndex(_:_:)](imageio/cgimagesourceremovecacheatindex(_:_:).md)
