---
title: "borderRect(forBounds:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextfield/borderrect(forbounds:)"
---

# borderRect(forBounds:)

Returns the text field’s border rectangle.

## Declaration

```swift
func borderRect(forBounds bounds: CGRect) -> CGRect
```

## Parameters

- `bounds`: The bounding rectangle of the receiver.

## Return Value

Return Value The border rectangle for the receiver.

## Discussion

Discussion You should not call this method directly. If you want to provide a different border rectangle for drawing, you can override this method and return that rectangle. The default implementation of this method returns the original bounds rectangle.

## See Also

### Drawing and positioning overrides

- [textRect(forBounds:)](uikit/uitextfield/textrect(forbounds:).md)
- [drawText(in:)](uikit/uitextfield/drawtext(in:).md)
- [placeholderRect(forBounds:)](uikit/uitextfield/placeholderrect(forbounds:).md)
- [drawPlaceholder(in:)](uikit/uitextfield/drawplaceholder(in:).md)
- [editingRect(forBounds:)](uikit/uitextfield/editingrect(forbounds:).md)
- [clearButtonRect(forBounds:)](uikit/uitextfield/clearbuttonrect(forbounds:).md)
- [leftViewRect(forBounds:)](uikit/uitextfield/leftviewrect(forbounds:).md)
- [rightViewRect(forBounds:)](uikit/uitextfield/rightviewrect(forbounds:).md)
