<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/Frame/drawableTargetViewCount(target:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Compositor Services",
      "CompositorServices"
    ],
    "preciseIdentifier" : "c:@F@cp_frame_get_drawable_target_view_count"
  },
  "title" : "drawableTargetViewCount(target:)"
}
-->

# drawableTargetViewCount(target:)

Returns the number of view in the drawable target.

```
func drawableTargetViewCount(target drawable_target: LayerRenderer.Drawable.Target) -> Int
```

## Parameters

`drawable_target`

whether this is intended for `built_in` or `recorder`drawable

## Return Value

The number of views available for drawing. For example, a return
value of `2` indicates there are two views for this target drawable in this frame.
value of `0` indicates there is no view available for this target drawable in this frame.

## Discussion

Use the returned value as the maximum number of views to retrieve
from the [`cp_frame_binocular_frustum_matrix_for_drawable_target`](/documentation/CompositorServices/cp_frame_binocular_frustum_matrix_for_drawable_target)
or [`cp_frame_monocular_frustum_matrix_for_drawable_target`](/documentation/CompositorServices/cp_frame_monocular_frustum_matrix_for_drawable_target) functions.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)