Contents

tryToPerform(_:with:)

Dispatches an action message to the specified target.

Declaration

func tryToPerform(_ action: Selector, with object: Any?) -> Bool

Parameters

  • action:

    The action message you want to dispatch.

  • object:

    The target object that defines the specified selector.

Return Value

true if either the receiver or its delegate can accept the specified selector; otherwise, false. This method also returns false if aSelector is nil.

Discussion

The receiver tries to perform the method aSelector using its inherited tryToPerform(_:with:) method of NSResponder. If the receiver doesn’t perform aSelector, the delegate is given the opportunity to perform it using its inherited perform(_:with:) method of NSObject.

See Also

Related Documentation

Posting actions