---
title: "init(frame:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uiswitch/init(frame:)"
---

# init(frame:)

Creates a switch control.

## Declaration

```swift
init(frame: CGRect)
```

## Parameters

- `frame`: A rectangle defining the frame of the doc://com.apple.uikit/documentation/UIKit/UISwitch object. The size components of this rectangle are ignored.

## Return Value

Return Value An initialized UISwitch object.

## Discussion

Discussion UISwitch overrides init(frame:) and enforces a size appropriate for the control.

## See Also

### Creating a switch

- [init(coder:)](uikit/uiswitch/init(coder:).md)
