Skip to content

swift_dynamicCastMetatype(____)

0x41c edited this page Feb 28, 2022 · 1 revision

swift_dynamicCastMetatype(_:_:)

Check to determine if a cast will succeed from one type to a metatype.

@_silgen_name("swift_dynamicCastMetatype")
public func swift_dynamicCastMetatype(
    _ sourceType: Any.Type,
    _ targetType: Any.Type
) -> Any.Type?

The target type should be a superclass of the source type.

Parameters

  • sourceType: The source type in the validation.
  • targetType: The type to validate a dynamic cast from.

Returns

The source type if the cast succeeds. If not, a nullptr is returned.

Types
Protocols
Global Typealiases
Global Functions
Clone this wiki locally