# GARAnchor

ARCore anchor class.

A `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor` is an immutable snapshot of an underlying anchor at a particular timestamp. All snapshots of the same underlying anchor will have the same identifier.

## Summary

### Inheritance

Inherits from: `NSObject`, `<NSCopying>`

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#cloudidentifier` | `NSString *` Cloud Anchor identifier, if applicable. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#cloudstate` | `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstate` The Cloud Anchor state, if applicable. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#hasvalidtransform` | `BOOL` Whether or not this anchor has a valid transform. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#identifier` | `NSUUID *` Unique Identifier for this anchor. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#terrainstate` | `https://developers.google.com/ar/reference/ios/group/GARTerrainAnchorState#garterrainanchorstate` The Terrain anchor state, if applicable. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate` | `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstate` The tracking state of the anchor. |
| `https://developers.google.com/ar/reference/ios/interface/GARAnchor#transform` | `matrix_float4x4` Transform of anchor relative to world origin. |

## Properties

### cloudIdentifier

```
@property(nonatomic, readonly, nullable) NSString *cloudIdentifier;
```
Cloud Anchor identifier, if applicable.

This will be `nil` unless the cloud state of the anchor is `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstatesuccess`.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARAnchor(CloudAnchors)#category_g_a_r_anchor_07_cloud_anchors_08_1ad7d3a00f3464e1e8eca8da3203d2703a`.

### cloudState

```
@property(nonatomic, readonly) https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstate cloudState;
```
The Cloud Anchor state, if applicable.

Indicates the state of the hosting or resolving operation on this anchor, if any.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARAnchor(CloudAnchors)#category_g_a_r_anchor_07_cloud_anchors_08_1ad07e7c3d0fc02d8987b8b73d0297ec9b`.

### hasValidTransform

```
@property(nonatomic, readonly) BOOL https://developers.google.com/ar/reference/ios/interface/GARAnchor#hasvalidtransform;
```
Whether or not this anchor has a valid transform.

Equivalent to `self.trackingState == https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`.

### identifier

```
@property(nonatomic, readonly) NSUUID *https://developers.google.com/ar/reference/ios/interface/GARAnchor#identifier;
```
Unique Identifier for this anchor.

`isEqual:` will return `YES` for another `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor` with the same identifier, and the `hash` method is also computed from the identifier.

### terrainState

```
@property(nonatomic, readonly) https://developers.google.com/ar/reference/ios/group/GARTerrainAnchorState#garterrainanchorstate terrainState;
```
The Terrain anchor state, if applicable.

Indicates the state of the resolving operation on this anchor, if any.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARAnchor(Geospatial)#category_g_a_r_anchor_07_geospatial_08_1aa70e610288fc6447167fba1d572004b8`.

### trackingState

```
@property(nonatomic, readonly) https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstate https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate;
```
The tracking state of the anchor.

### transform

```
@property(nonatomic, readonly) matrix_float4x4 https://developers.google.com/ar/reference/ios/interface/GARAnchor#transform;
```
Transform of anchor relative to world origin.

This should only be considered valid if the property `https://developers.google.com/ar/reference/ios/interface/GARAnchor#hasvalidtransform` returns `YES`.