PTOverridable

@protocol PTOverridable <NSObject>

A class conforming to the PTOverridable protocol can be overridden with a subclass, registered with the PTOverrides class. Once registered, the provided subclass will be used instead of the original class wherever an instance is created.

  • Returns a new instance of the receiving class, or a subclass if the receiving class has been overridden.

    Declaration

    Objective-C

    + (nonnull instancetype)allocOverridden;

    Swift

    optional static func allocOverridden() -> Self

    Return Value

    a new instance of the receiving class or a subclass