---
title: "attribute(of:)"
framework: roomplan
role: symbol
role_heading: Instance Method
path: "roomplan/capturedroom/object/attribute(of:)"
---

# attribute(of:)

Checks an object for specific attribute types.

## Declaration

```swift
func attribute<T>(of attributeType: T.Type) -> T? where T : CapturedRoomAttribute
```

## Discussion

Discussion This function provides details about an object based on attribute type. For example, the following code checks whether an object the framework observes during a scan resembles a dining table: let chairType = object.attribute(of: ChairType.self) if chairType == .dining { /* ... */ }

## See Also

### Describing an object

- [attributes](roomplan/capturedroom/object/attributes.md)
