world(name:)
Returns the custom content world with the specified name.
Declaration
class func world(name: String) -> WKContentWorldParameters
- name:
The name of the content world you want. If no content world with that name exists, this method creates a new 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
The content world with the specified name.
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.