NSObject

extension NSObject
  • Returns an array of all class objects within the running swift program that conform to a given protocol.

    Declaration

    Swift

    public func classesConformingToProtocol(_ protocol: Protocol) -> [AnyClass]

    Parameters

    protocol

    The protocol to be used to check for conformance

    Return Value

    An array of class objects