---
title: "isMember(of:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobjectprotocol/ismember(of:)"
---

# isMember(of:)

Returns a Boolean value that indicates whether the receiver is an instance of a given class.

## Declaration

```swift
func isMember(of aClass: AnyClass) -> Bool
```

## Parameters

- `aClass`: A class object representing the Objective-C class to be tested.

## Return Value

Return Value YES if the receiver is an instance of aClass, otherwise NO.

## Discussion

Discussion For example, in this code, isMember(of:) would return NO: NSMutableData *myData = [NSMutableData dataWithCapacity:30]; id anArchiver = [[NSArchiver alloc] initForWritingWithMutableData:myData]; if ([anArchiver isMemberOfClass:[NSCoder class]])     ... Class objects may be compiler-created objects but they still support the concept of membership. Thus, you can use this method to verify that the receiver is a specific Class object.

## See Also

### Testing Object Inheritance, Behavior, and Conformance

- [isKind(of:)](objectivec/nsobjectprotocol/iskind(of:).md)
- [responds(to:)](objectivec/nsobjectprotocol/responds(to:).md)
- [conforms(to:)](objectivec/nsobjectprotocol/conforms(to:).md)
