---
title: "filenameExtension(_:isValidForType:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsworkspace/filenameextension(_:isvalidfortype:)"
---

# filenameExtension(_:isValidForType:)

Returns whether the specified filename extension is appropriate for the Uniform Type Identifier (UTI).

## Declaration

```swift
func filenameExtension(_ filenameExtension: String, isValidForType typeName: String) -> Bool
```

## Parameters

- `filenameExtension`: A string containing the filename extension.
- `typeName`: A string containing the UTI.

## Return Value

Return Value true if fileNameExtension is a valid extension for typeName; otherwise, false.

## Discussion

Discussion You can safely call this method from any thread of your app.

## See Also

### Manipulating Uniform Type Identifier Information

- [type(ofFile:)](appkit/nsworkspace/type(offile:).md)
- [localizedDescription(forType:)](appkit/nsworkspace/localizeddescription(fortype:).md)
- [preferredFilenameExtension(forType:)](appkit/nsworkspace/preferredfilenameextension(fortype:).md)
- [type(_:conformsToType:)](appkit/nsworkspace/type(_:conformstotype:).md)
