---
title: "init(rect:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/cifiltershape/init(rect:)"
---

# init(rect:)

Initializes a filter shape object with a rectangle.

## Declaration

```swift
init(rect r: CGRect)
```

## Parameters

- `r`: A rectangle. Core Image uses the rectangle specified by integer parts of the values in the CGRect data structure.

## Return Value

Return Value An initialized CIFilterShape object, or nil if the method fails.
