---
title: level
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/filemanager/directoryenumerator/level
---

# level

The number of levels deep the current object is in the directory hierarchy being enumerated.

## Declaration

```swift
var level: Int { get }
```

## Discussion

Discussion The number of levels, with the directory passed to enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: (NSFileManager) considered to be level 0.

## See Also

### Getting File and Directory Attributes

- [directoryAttributes](foundation/filemanager/directoryenumerator/directoryattributes.md)
- [fileAttributes](foundation/filemanager/directoryenumerator/fileattributes.md)
