---
title: entity()
framework: coredata
role: symbol
role_heading: Type Method
path: coredata/nsmanagedobject/entity()
---

# entity()

Returns the entity description that is associated with this subclass.

## Declaration

```swift
class func entity() -> NSEntityDescription
```

## Discussion

Discussion This method is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.

## See Also

### Getting a Managed Object’s Identity

- [entity](coredata/nsmanagedobject/entity-swift.property.md)
- [objectID](coredata/nsmanagedobject/objectid.md)
