coerceValue(_:to:)
Returns an object of a given class representing a given value.
Declaration
func coerceValue(_ value: Any, to toClass: AnyClass) -> Any?Parameters
- value:
The value to coerce.
- toClass:
The class with which to represent
value.
Return Value
An object of the class toClass representing the value specified by value. Returns nil if an error occurs.