PTToolsSettingsManager

@interface PTToolsSettingsManager : NSObject

A class that manages user prefrences.

The settings in this class are use by the PTDocumentBaseViewController to control its behaviour, except as noted in the documentation for each setting.

  • The global instance of the shared tools settings manager.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, class)
        PTToolsSettingsManager *_Nonnull sharedManager;

    Swift

    class var shared: PTToolsSettingsManager { get }
  • The default settings. These are the values that are contained in the settings plist file, PTToolsSettings.plist, not necessarily the current values.

    Declaration

    Objective-C

    @property (readonly, retain, nonatomic)
        NSArray<NSDictionary<NSString *, id> *> *_Nonnull toolsDefaultSettings;

    Swift

    var toolsDefaultSettings: [[String : Any]] { get }
  • Determines if freehand annotation tool is shown in the main toolbar.

    Default is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showInkInMainToolbar;

    Swift

    var showInkInMainToolbar: Bool { get set }
  • Determines if the text search tool is shown in the main toolbar.

    Default is true on iPad, false on iPhone.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showTextSearchInMainToolbar;

    Swift

    var showTextSearchInMainToolbar: Bool { get set }
  • Determines if shape annotations are automatically selected after the user creates them.

    Default is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL selectAnnotationAfterCreation;

    Swift

    var selectAnnotationAfterCreation: Bool { get set }
  • Determines if tabs for documents are enabled in the viewer.

    Default is true.

    Note

    this setting is not used by the PTTabbedDocumentViewController, and should instead be read and acted upon by the app itself.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL tabsEnabled;

    Swift

    var tabsEnabled: Bool { get set }
  • Determines if the toolbars should be hidden automatically after 5 seconds.

    Default is false.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL automaticallyHideToolbars;

    Swift

    var automaticallyHideToolbars: Bool { get set }
  • Determines if PDFTron should execute any JavaScript contained in a PDF.

    Default is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL javascriptEnabled;

    Swift

    var javascriptEnabled: Bool { get set }
  • Determines if an Apple Pencil should immediately draw ink (as opposed to function like a finger touch).

    Default is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL applePencilDrawsInk;

    Swift

    var applePencilDrawsInk: Bool { get set }
  • Determines if freehand (ink) annotations should be created using PenckilKit (iOS 13.1+), or a standard curved line.

    Default is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL freehandUsesPencilKit;

    Swift

    var freehandUsesPencilKit: Bool { get set }
  • Determines if the device should be stopped from dimming when a document is displayed. Default is false.

    Note

    this setting is not used by the PTDocumentVIewController, and should instead be read and acted upon by the app itself.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL stopScreenFromDimming;

    Swift

    var stopScreenFromDimming: Bool { get set }
  • Returns the boolean value for a given setting key value.

    Declaration

    Objective-C

    - (BOOL)boolForKey:(nonnull NSString *)key;

    Swift

    func bool(forKey key: String) -> Bool
  • Sets the boolean value for a given setting key value.

    Declaration

    Objective-C

    - (void)setBool:(BOOL)value forKey:(nonnull NSString *)key;

    Swift

    func setBool(_ value: Bool, forKey key: String)