---
title: "addSwitch(descriptor:)"
framework: Touch Controller
role: symbol
role_heading: Instance Method
platforms: [iOS 26.0+, iPadOS 26.0+, Mac Catalyst 26.0+]
path: "touchcontroller/tctouchcontroller/addswitch(descriptor:)"
---

# addSwitch(descriptor:)

Creates a new switch control with the provided descriptor, and adds it to the touch controller.

## Declaration

```swift
func addSwitch(descriptor: TCSwitchDescriptor) -> TCSwitch
```

## Parameters

- `descriptor`: The TCSwitchDescriptor containing the configuration for the switch.

## Return Value

Return Value A new TCSwitch instance.

## See Also

### Adding a switch control

- [TCSwitchDescriptor](touchcontroller/tcswitchdescriptor.md)
