Function

class_respondsToSelector(_:_:)

Returns a Boolean value that indicates whether instances of a class respond to a particular selector.

Declaration

func class_respondsToSelector(_ cls: AnyClass!, _ sel: Selector!) -> Bool

Parameters

cls

The class you want to inspect.

sel

A selector.

Return Value

true if instances of the class respond to the selector, otherwise false.

Discussion

You should usually use NSObject's responds(to:) or instancesRespond(to:) methods instead of this function.