init(object:in:)
Creates a JavaScript value by converting the specified native object.
Declaration
init!(object value: Any!, in context: JSContext!)Parameters
- value:
The Objective-C or Swift object to be made available to JavaScript.
- context:
The JavaScript context in which to create the value.
Return Value
A new JavaScript value representing the object.
Discussion
Converting a native object creates a JavaScript object, including a constructor and prototype chain that reflects the object’s inheritance in the Objective-C or Swift type hierarchy. By default, properties and methods on the converted object are not exposed to JavaScript: to choose which properties and methods should be visible to JavaScript, see JSExport.
Creating a JSValue instance that wraps a native object retains the underlying Objective-C or Swift object.
See Also
Creating JavaScript Values
init(bool:in:)init(double:in:)init(int32:in:)init(uInt32:in:)init(newObjectIn:)init(newArrayIn:)init(newRegularExpressionFromPattern:flags:in:)init(newErrorFromMessage:in:)init(undefinedIn:)init(nullIn:)init(point:inContext:)init(range:inContext:)init(rect:inContext:)init(size:inContext:)init(newSymbolFromDescription:in:)