---
title: "world(name:)"
framework: webkit
role: symbol
role_heading: Type Method
path: "webkit/wkcontentworld/world(name:)"
---

# world(name:)

Returns the custom content world with the specified name.

## Declaration

```swift
class func world(name: String) -> WKContentWorld
```

## Parameters

- `name`: The name of the content world you want. If no content world with that name exists, this method creates a new doc://com.apple.webkit/documentation/WebKit/WKContentWorld object and returns it. The next time you request a content world with the same name, this method returns the object it previously created.

## Return Value

Return Value The content world with the specified name.

## Discussion

Discussion Use this method to create unique content worlds for your script code. For example, if you execute scripts from multiple JavaScript extensions, you might use this method to create a content world based on a unique string associated with that extension.

## See Also

### Retrieving a Custom Content World

- [name](webkit/wkcontentworld/name.md)
