<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/UIViewRepresentableContext",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI26UIViewRepresentableContextV"
  },
  "title" : "UIViewRepresentableContext"
}
-->

# UIViewRepresentableContext

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

```
@MainActor @preconcurrency struct UIViewRepresentableContext<Representable> where Representable : UIViewRepresentable
```

## Overview

A [`UIViewRepresentableContext`](/documentation/SwiftUI/UIViewRepresentableContext) structure contains details about the
current state of the system. When creating and updating your view, the
system creates one of these structures and passes it to the appropriate
method of your custom [`UIViewRepresentable`](/documentation/SwiftUI/UIViewRepresentable) instance. Use the information
in this structure to configure your view. For example, use the provided
environment values to configure the appearance of your view. Don’t create
this structure yourself.

## Topics

### Coordinating view-related interactions

[`coordinator`](/documentation/SwiftUI/UIViewRepresentableContext/coordinator)

The view’s associated coordinator.

[`transaction`](/documentation/SwiftUI/UIViewRepresentableContext/transaction)

The current transaction.

### Getting the current environment data

[`environment`](/documentation/SwiftUI/UIViewRepresentableContext/environment)

The current environment.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)