<!--
{
  "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/UIViewControllerRepresentable/makeUIViewController(context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI29UIViewControllerRepresentableP04makecD07context0cD4TypeQzAA0cdE7ContextVyxG_tF"
  },
  "title" : "makeUIViewController(context:)"
}
-->

# makeUIViewController(context:)

Creates the view controller object and configures its initial state.

```
@MainActor @preconcurrency func makeUIViewController(context: Self.Context) -> Self.UIViewControllerType
```

## Parameters

`context`

A context structure containing information about
the current state of the system.

## Return Value

Your UIKit view controller configured with the provided
information.

## Discussion

You must implement this method and use it to create your view controller
object. Create the view controller using your app’s current data and
contents of the `context` parameter. The system calls this method only
once, when it creates your view controller for the first time. For all
subsequent updates, the system calls the
[`updateUIViewController(_:context:)`](/documentation/SwiftUI/UIViewControllerRepresentable/updateUIViewController(_:context:))
method.

---

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)