<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNText/containerFrame",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNText(py)containerFrame"
  },
  "title" : "containerFrame"
}
-->

# containerFrame

A rectangle specifying the area in which SceneKit should lay out the text.

```
var containerFrame: CGRect { get set }
```

## Discussion

SceneKit can lay out a body of text to fit within a rectangular area. To do this, you must first use this property to define the area for text layout as a rectangle in the x- and y-axis dimensions of the text object’s local coordinate system. Then you use the [`isWrapped`](/documentation/SceneKit/SCNText/isWrapped), [`alignmentMode`](/documentation/SceneKit/SCNText/alignmentMode), and [`truncationMode`](/documentation/SceneKit/SCNText/truncationMode) properties to control how SceneKit fits the text into the container frame. Text layout begins in the upper left corner of the rectangle.

The default value of this property is <doc://com.apple.documentation/documentation/CoreGraphics/CGRectZero>, specifying that SceneKit should lay out the text on one line without wrapping or truncation.

Depending on the content and style of the text and the values of the [`isWrapped`](/documentation/SceneKit/SCNText/isWrapped), [`alignmentMode`](/documentation/SceneKit/SCNText/alignmentMode), and [`truncationMode`](/documentation/SceneKit/SCNText/truncationMode) properties, the text may not fit within the container frame after layout, or it may occupy a smaller area.

---

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)