---
title: class
framework: objectivec
role: symbol
role_heading: Type Method
path: objectivec/nsobject-swift.class/class
---

# class

Returns the class object.

## Declaration

```occ
+ (Class) class;
```

## Return Value

Return Value The class object.

## Discussion

Discussion Refer to a class only by its name when it is the receiver of a message. In all other cases, the class object must be obtained through this or a similar method. For example, here SomeClass is passed as an argument to the isKind(of:) method (declared in the NSObject protocol): BOOL test = [self isKindOfClass:[SomeClass class]];

## See Also

### Related Documentation

- [NSStringFromClass(_:)](foundation/nsstringfromclass(_:).md)
- [class](objectivec/nsobject-c.protocol/class.md)
- [NSClassFromString(_:)](foundation/nsclassfromstring(_:).md)

### Identifying Classes

- [superclass()](objectivec/nsobject-swift.class/superclass().md)
- [isSubclass(of:)](objectivec/nsobject-swift.class/issubclass(of:).md)
