<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NSViewControllerRepresentable/makeCoordinator()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI29NSViewControllerRepresentableP15makeCoordinator0G0QzyF"
  },
  "title" : "makeCoordinator()"
}
-->

# makeCoordinator()

Creates the custom object that you use to communicate changes from your
view controller to other parts of your SwiftUI interface.

```
@MainActor @preconcurrency func makeCoordinator() -> Self.Coordinator
```

## Discussion

Implement this method if changes to your view controller might affect
other parts of your app. In your implementation, create a custom Swift
instance that can communicate with other parts of your interface. For
example, you might provide an instance that binds its variables to
SwiftUI properties, causing the two to remain synchronized. If your view
controller doesn’t interact with other parts of your app, providing a
coordinator is unnecessary.

SwiftUI calls this method before calling the
[`makeNSViewController(context:)`](/documentation/SwiftUI/NSViewControllerRepresentable/makeNSViewController(context:)) method.
The system provides your coordinator instance either directly or as part
of a context structure when calling the other methods of your
representable instance.

---

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)