- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
JSValue instance originates from a
context object—as long as any value associated with a particular
JSContext instance is retained, that context remains alive. When you invoke an instance method is invoked on a
JSValue object, and that method returns another
JSValue object, the returned value belongs to the same context as original value.
context property) with a specific
JSVirtual object representing the underlying set of execution resources for its context. You can pass
JSValue instances only to methods on
JSContext instances hosted by the same virtual machine—attempting to pass a value to a different virtual machine raises an Objective-C exception.
Objective-C blocks (or Swift closures with the
Objective-C (and Swift) Types
Conversion is consistent with the following methods:
Objective-C or Swift object (
Objective-C or Swift class (
Other structure types are not supported.
Objective-C block (Swift closure)