---
title: fileType()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsdictionary/filetype()
---

# fileType()

Returns the file type.

## Declaration

```swift
func fileType() -> String?
```

## Return Value

Return Value The value associated with the type file attributes key, or nil if the file attributes dictionary has no entry for the key. For possible values, see FileAttributeType.

## See Also

### Accessing File Attributes

- [fileSize()](foundation/nsdictionary/filesize().md)
- [fileCreationDate()](foundation/nsdictionary/filecreationdate().md)
- [fileModificationDate()](foundation/nsdictionary/filemodificationdate().md)
- [filePosixPermissions()](foundation/nsdictionary/fileposixpermissions().md)
- [fileOwnerAccountID()](foundation/nsdictionary/fileowneraccountid().md)
- [fileOwnerAccountName()](foundation/nsdictionary/fileowneraccountname().md)
- [fileGroupOwnerAccountID()](foundation/nsdictionary/filegroupowneraccountid().md)
- [fileGroupOwnerAccountName()](foundation/nsdictionary/filegroupowneraccountname().md)
- [fileExtensionHidden()](foundation/nsdictionary/fileextensionhidden().md)
- [fileIsImmutable()](foundation/nsdictionary/fileisimmutable().md)
- [fileIsAppendOnly()](foundation/nsdictionary/fileisappendonly().md)
- [fileSystemFileNumber()](foundation/nsdictionary/filesystemfilenumber().md)
- [fileSystemNumber()](foundation/nsdictionary/filesystemnumber().md)
- [fileHFSTypeCode()](foundation/nsdictionary/filehfstypecode().md)
- [fileHFSCreatorCode()](foundation/nsdictionary/filehfscreatorcode().md)
