---
title: sourceRect
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uipopoverpresentationcontroller/sourcerect
---

# sourceRect

The area in the source view in which you anchor the popover.

## Declaration

```swift
var sourceRect: CGRect { get set }
```

## Mentioned in

Getting the user’s attention with alerts and action sheets

## Discussion

Discussion Use this property to define the rectangle that the popover’s arrow points to. The rectangle must be in the coordinate space of sourceView. In iOS 13.2 and later, the default value is CGRectNull, which instructs the system to use the current frame of sourceView. The controller observes changes to this frame and updates the popover accordingly. In iOS 13.1 and earlier, the default value is zero (Swift) or CGRectZero (Objective-C); using CGRectNull results in undefined behavior. UIPopoverPresentationController ignores this property if you set the barButtonItem property.

## See Also

### Specifying the popover’s anchor point

- [sourceItem](uikit/uipopoverpresentationcontroller/sourceitem.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [sourceView](uikit/uipopoverpresentationcontroller/sourceview.md)
- [barButtonItem](uikit/uipopoverpresentationcontroller/barbuttonitem.md)
