Instance Method


Sets the classes that can appear within the (numerically) specified collection object argument to the specified method.


func setClasses(_ classes: Set<AnyHashable>, for sel: Selector, argumentIndex arg: Int, ofReply: Bool)



An NSSet containing Class objects—for example, [MyObject class].


Specifies which method in the protocol is being configured.


Specifies the position (starting at index 0) of the parameter for which you are allowing classes. This may be either the position of a parameter in the method itself or the position in its reply block.


Pass true if arg is an index into the parameters of the reply block, or false if it is an index into the parameters of the method itself.


If an argument to a method in your protocol is a collection class (for example, NSArray or NSDictionary), then you must explicitly specify the set of expected classes that may appear within that collection.

If the expected classes are all property list types, calling this method is optional; property list types are allowed by default inside collection objects. You may, however, call this method to further restrict the set of allowed classes.