---
title: "object_getClass(_:)"
framework: objectivec
role: symbol
role_heading: Function
path: "objectivec/object_getclass(_:)"
---

# object_getClass(_:)

Returns the class of an object.

## Declaration

```swift
func object_getClass(_ obj: Any?) -> AnyClass?
```

## Parameters

- `obj`: The object you want to inspect.

## Return Value

Return Value The class object of which object is an instance, or Nil if object is nil.

## See Also

### Working with Instances

- [object_getIndexedIvars(_:)](objectivec/object_getindexedivars(_:).md)
- [object_getIvar(_:_:)](objectivec/object_getivar(_:_:).md)
- [object_setIvar(_:_:_:)](objectivec/object_setivar(_:_:_:).md)
- [object_getClassName(_:)](objectivec/object_getclassname(_:).md)
- [object_setClass(_:_:)](objectivec/object_setclass(_:_:).md)
