<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebView-swift.class/init(frame:frameName:groupName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebView(im)initWithFrame:frameName:groupName:"
  },
  "title" : "init(frame:frameName:groupName:)"
}
-->

# init(frame:frameName:groupName:)

Initializes the receiver with a frame rectangle, frame name, and group name.

```
init!(frame: NSRect, frameName: String!, groupName: String!)
```

## Parameters

`frame`

The frame rectangle for the created view object.

`frameName`

The web frame’s name. This should not be one of the predefined frame names (see the `WebFrame```WebFrame/findNamed(_:)`` method for a description of their meaning), but a custom name or a name used in HTML source. This parameter can be `nil`.

`groupName`

An arbitrary identifier used to group related frames. For example, JavaScript running in a frame can access any other frame in the same group. It’s up to the application how it chooses to scope related frames. This parameter can be `nil`.

## Return Value

An initialized view object or `nil` if the object couldn’t be created.

## Discussion

This method is the designated initializer for the `WebView` class.

---

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)