---
title: "makeNSView(context:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/nsviewrepresentable/makensview(context:)"
---

# makeNSView(context:)

Creates the view object and configures its initial state.

## Declaration

```swift
@MainActor @preconcurrency func makeNSView(context: Self.Context) -> Self.NSViewType
```

## Parameters

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

## Return Value

Return Value Your AppKit view configured with the provided information.

## Discussion

Discussion You must implement this method and use it to create your view object. Configure the view using your app’s current data and contents of the context parameter. The system calls this method only once, when it creates your view for the first time. For all subsequent updates, the system calls the updateNSView(_:context:) method.

## See Also

### Creating and updating the view

- [updateNSView(_:context:)](swiftui/nsviewrepresentable/updatensview(_:context:).md)
- [NSViewRepresentable.Context](swiftui/nsviewrepresentable/context.md)
- [NSViewType](swiftui/nsviewrepresentable/nsviewtype.md)
