---
title: UIViewControllerRepresentableContext
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/uiviewcontrollerrepresentablecontext
---

# UIViewControllerRepresentableContext

Contextual information about the state of the system that you use to create and update your UIKit view controller.

## Declaration

```swift
@MainActor @preconcurrency struct UIViewControllerRepresentableContext<Representable> where Representable : UIViewControllerRepresentable
```

## Overview

Overview A UIViewControllerRepresentableContext structure contains details about the current state of the system. When creating and updating your view controller, the system creates one of these structures and passes it to the appropriate method of your custom UIViewControllerRepresentable instance. Use the information in this structure to configure your view controller. For example, use the provided environment values to configure the appearance of your view controller and views. Don’t create this structure yourself.

## Topics

### Coordinating view controller interactions

- [coordinator](swiftui/uiviewcontrollerrepresentablecontext/coordinator.md)
- [transaction](swiftui/uiviewcontrollerrepresentablecontext/transaction.md)

### Getting the environment data

- [environment](swiftui/uiviewcontrollerrepresentablecontext/environment.md)

### Instance Methods

- [animate(changes:completion:)](swiftui/uiviewcontrollerrepresentablecontext/animate(changes:completion:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Adding UIKit views to SwiftUI view hierarchies

- [UIViewRepresentable](swiftui/uiviewrepresentable.md)
- [UIViewRepresentableContext](swiftui/uiviewrepresentablecontext.md)
- [UIViewControllerRepresentable](swiftui/uiviewcontrollerrepresentable.md)
