<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISegmentedControl/contentOffsetForSegment(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISegmentedControl(im)contentOffsetForSegmentAtIndex:"
  },
  "title" : "contentOffsetForSegment(at:)"
}
-->

# contentOffsetForSegment(at:)

Returns the offset for drawing the content (image or text) of the segment you specify.

```
func contentOffsetForSegment(at segment: Int) -> CGSize
```

## Parameters

`segment`

An index number that identifies a segment in the control. It must be a number between 0 and the number of segments ([`numberOfSegments`](/documentation/UIKit/UISegmentedControl/numberOfSegments)) minus 1; the segmented control pins values exceeding this upper range to the last segment.

## Return Value

The offset (as a <doc://com.apple.documentation/documentation/CoreFoundation/CGSize> structure) from the origin of the segment at which to draw the segment’s content.

---

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)