PSPDFDocumentFeaturesSource

@protocol PSPDFDocumentFeaturesSource <NSObject>

A document feature source can disable various features if there are reasons within its controlled scope that make this feature unavailable.

You can implement your own sources by conforming to this protocol. Besides the required methods you should only implement the features that your source actually control. The result of your source will be combined with the results of the framework’s sources through a logical AND. This means if your source disallows a feature this feature is no longer available, however if your source allows a feature there might still be other sources disallowing a feature. Only if all sources allow a feature, the feature will be enabled.

Caching

The results of all features you implement will be cached. Whenever the state of a feature changes, you need to call [features updateFeatures] for changes to take effect. This is also necessary to allow notifying interested observers about the change in state.

Threading

Your custom sources have to be thread safe. They are not guaranteed to be called on any particular queue.

  • A back reference to the PSPDFDocumentFeatures instance that owns this source.

    You can use this reference when implementing you own custom sources to call updateFeatures on it whenever a feature changes its state.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) PSPDFDocumentFeatures *_Nullable features;

    Swift

    weak var features: PSPDFDocumentFeatures? { get set }
  • Specifies whether the document this feature belongs to can be modified.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) BOOL canModify;

    Swift

    optional var canModify: Bool { get }
  • Specifies whether bookmarks can be added, removed or edited in the document this feature belongs.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) BOOL canEditBookmarks;

    Swift

    optional var canEditBookmarks: Bool { get }
  • Specifies whether the document can be printed on this device.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) BOOL canPrint;

    Swift

    optional var canPrint: Bool { get }
  • Specifies whether annotation replies should be shown.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) BOOL canShowAnnotationReplies;

    Swift

    optional var canShowAnnotationReplies: Bool { get }