---
title: "init(frame:sticker:)"
framework: messages
role: symbol
role_heading: Initializer
path: "messages/msstickerview/init(frame:sticker:)"
---

# init(frame:sticker:)

Initializes a new sticker view with the provided sticker and frame.

## Declaration

```swift
init(frame: CGRect, sticker: MSSticker?)
```

## Parameters

- `frame`: A rectangular frame for the view, measured in points. The origin of the frame is relative to its superview. This method uses the provided rectangle to set the view’s doc://com.apple.documentation/documentation/UIKit/UIView/center and doc://com.apple.documentation/documentation/UIKit/UIView/bounds properties.
- `sticker`: The sticker object to be displayed. Pass nil to create an empty sticker view.

## Return Value

Return Value A newly initialized sticker view.

## Discussion

Discussion If the sticker image is larger than the view’s frame, the view scales down the sticker to fit. If the frame is larger than the sticker image, the view centers the image in the frame.

## See Also

### Working with Sticker Views

- [sticker](messages/msstickerview/sticker.md)
