StandaloneDelegate

Swift

open class StandaloneDelegate<DelegateType> : NSObject where DelegateType : NSObjectProtocol

Base class that helps to build standalone delegate handlers. Class will live as long as bound target lives. Automatically forwards non-implemented delegate overrides to the originalDelegate, if one is set.

Example Usage: class DocumentSharingDelegateHandler: StandaloneDelegate, PDFDocumentSharingViewControllerDelegate { (your delegate implementations) } // The StandaloneDelegateContainer will automatically manage the lifetime of this helper. // It will be deallocated as soon as sharingController is deallocated. let handler = DocumentSharingHandler(delegateTarget: sharingController, originalDelegate: sharingController.delegate) sharingController.delegate = handler

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public init(delegateTarget: AnyObject, originalDelegate: DelegateType? = nil)
  • Undocumented

    Declaration

    Swift

    override open func forwardingTarget(for aSelector: Selector!) -> Any?
  • Undocumented

    Declaration

    Swift

    override open func responds(to aSelector: Selector!) -> Bool