PTToolsUtil


@interface PTToolsUtil : NSObject

Utility methods for the Tools framework.

  • Returns an image in the tools bundle, regardless of extension.

    Declaration

    Objective-C

    + (nullable UIImage *)toolImageNamed:(nonnull NSString *)name;

    Swift

    class func toolImageNamed(_ name: String) -> UIImage?

    Parameters

    name

    The name of the image, with or without an extension.

    Return Value

    A UIImage created from the named file.

  • Returns an image in the tools bundle, regardless of extension.

    Declaration

    Objective-C

    + (nullable UIImage *)toolImageNamed:(nonnull NSString *)name
                                inverted:(BOOL)inverted;

    Swift

    class func toolImageNamed(_ name: String, inverted: Bool) -> UIImage?

    Parameters

    name

    The name of the image, with or without an extension.

    inverted

    If true, returns a color-inverted version of the image

    Return Value

    A UIImage created from the named file.

  • Creates a 1 page PTPDFDoc from a UIView.

    Declaration

    Objective-C

    + (nonnull PTPDFDoc *)createPTPDFDocFromFromUIView:(nonnull UIView *)aView;

    Swift

    class func createPTPDFDocFrom(from aView: UIView) -> PTPDFDoc

    Parameters

    aView

    The view to turn into a PDF

    Return Value

    a PDF created from the view.

  • Reset settings to defaults.

    Declaration

    Objective-C

    + (void)resetSettings;

    Swift

    class func resetSettings()
  • Returns the tool image for an annotation type.

    Declaration

    Objective-C

    + (nullable UIImage *)imageForAnnotationType:
        (PTExtendedAnnotType)annotationType;

    Swift

    class func image(forAnnotationType annotationType: PTExtendedAnnotType) -> UIImage?
  • The Tools framework bundle.

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) NSBundle *_Nonnull toolsBundle;

    Swift

    class var toolsBundle: Bundle { get }
  • The directory URL for Tools-specific saved resources, data and configuration files, etc.

    Declaration

    Objective-C

    @property (class, nonatomic, readonly, nullable) NSURL *toolsResourcesDirectoryURL;

    Swift

    class var toolsResourcesDirectoryURL: URL? { get }