---
title: "init(contentSource:)"
framework: avkit
role: symbol
role_heading: Initializer
path: "avkit/avpictureinpicturecontroller/init(contentsource:)"
---

# init(contentSource:)

Creates a Picture in Picture controller with a content source.

## Declaration

```swift
init(contentSource: AVPictureInPictureController.ContentSource)
```

## Parameters

- `contentSource`: The source of the content to show in a Picture in Picture window.

## Discussion

Discussion Use this initializer to create a controller that displays its content in a player layer or a sample buffer display layer. important: Before attempting to create a controller, verify that the current device supports Picture in Picture by calling the isPictureInPictureSupported() class method. Attempting to create a Picture in Picture controller on an unsupported device returns nil.

## See Also

### Creating a Controller

- [init(playerLayer:)](avkit/avpictureinpicturecontroller/init(playerlayer:).md)
