class func resolveClassMethod (Selector!) -> Bool
The name of a selector to resolve. この名前のセレクタを解決します。
Availability
Technology
name
The name of a selector to resolve. この名前のセレクタを解決します。
true
if the method was found and added to the receiver, otherwise false
.
This method and resolve
allow you to dynamically provide an implementation for a given selector.
An Objective-C method is simply a C function that take at least two arguments—self
and _cmd
. Using the class
function, you can add a function to a class as a method. Given the following function:
以下の関数を与えられて:
you can use resolve
to dynamically add it to a class as a method (called resolve
) like this:
This method is called before the Objective-C forwarding mechanism is invoked.
このメソッドは、Objective-Cの転送メカニズムが発動される前に呼び出されます。
If responds(to:)
or instances
is invoked, the dynamic method resolver is given the opportunity to provide an IMP
for the given selector first.
class func resolveClassMethod (Selector!) -> Bool