<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TouchController",
  "identifier" : "/documentation/TouchController/TCSwitchDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Touch Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)TCSwitchDescriptor"
  },
  "title" : "TCSwitchDescriptor"
}
-->

# TCSwitchDescriptor

A descriptor for configuring a switch.

```
class TCSwitchDescriptor
```

## Topics

### Creating the descriptor

[`init()`](/documentation/TouchController/TCSwitchDescriptor/init())

Creates a new switch descriptor with default values.

### Inspecting the descriptor

[`var contents: TCControlContents?`](/documentation/TouchController/TCSwitchDescriptor/contents)

The contents for the switch in its normal state.

[`var highlightDuration: TimeInterval`](/documentation/TouchController/TCSwitchDescriptor/highlightDuration)

The time it takes for a highlight to fade away, in seconds.

[`var label: TCControlLabel`](/documentation/TouchController/TCSwitchDescriptor/label)

The label you associate with the switch.

[`var offset: CGPoint`](/documentation/TouchController/TCSwitchDescriptor/offset)

The control’s offset from the anchor, which determines its position.

[`var size: CGSize`](/documentation/TouchController/TCSwitchDescriptor/size)

The size (width, height) of the switch in points.

[`var switchedOnContents: TCControlContents?`](/documentation/TouchController/TCSwitchDescriptor/switchedOnContents)

The contents for the switch when it is switched on.

[`var zIndex: Int`](/documentation/TouchController/TCSwitchDescriptor/zIndex)

The z-index of the switch. A lower z-index is drawn first.

### Accessing the anchor

[`var anchor: TCControlLayoutAnchor`](/documentation/TouchController/TCSwitchDescriptor/anchor)

The anchor point that the switch’s offset is relative to.

[`enum TCControlLayoutAnchor`](/documentation/TouchController/TCControlLayoutAnchor)

Defines the anchor point for a control.

[`var anchorCoordinateSystem: TCControlLayoutAnchorCoordinateSystem`](/documentation/TouchController/TCSwitchDescriptor/anchorCoordinateSystem)

The coordinate system for the control’s anchor point.

[`enum TCControlLayoutAnchorCoordinateSystem`](/documentation/TouchController/TCControlLayoutAnchorCoordinateSystem)

Defines the coodinate system for an anchor point.

### Getting the collider shape

[`var colliderShape: TCColliderShape`](/documentation/TouchController/TCSwitchDescriptor/colliderShape)

The shape of collider to use for the switch.

[`enum TCColliderShape`](/documentation/TouchController/TCColliderShape)

Defines the shape of a control collider.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)