PSPDFFreeTextAccessoryView

Swift

class FreeTextAccessoryView : Toolbar, FontPickerViewControllerDelegate, AnnotationStyleViewControllerDelegate, Overridable

Free Text accessory toolbar for faster styling.

  • The input accessory delegate.

    Declaration

    Objective-C

    @property (nonatomic, weak, readwrite)
        id<PSPDFFreeTextAccessoryViewDelegate> _Nullable delegate;

    Swift

    weak var delegate: FreeTextAccessoryViewDelegate? { get set }
  • Used to present popover pickers for certain button types.

    Declaration

    Objective-C

    @property (nonatomic, weak, readwrite)
        id<PSPDFPresentationContext> _Nullable presentationContext;

    Swift

    weak var presentationContext: PresentationContext? { get set }
  • The annotation that is being edited.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        PSPDFFreeTextAnnotation *_Nonnull annotation;

    Swift

    var annotation: PSPDFFreeTextAnnotation { get set }
  • Whether a thing border should be added just above the accessory view. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isBorderVisible) BOOL borderVisible;

    Swift

    var isBorderVisible: Bool { get set }
  • The color for the default separators and border.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        UI_APPEARANCE_SELECTOR UIColor *separatorColor;

    Swift

    var separatorColor: UIColor { get set }
  • By default the accessory view buttons differ based on the available toolbar width. Use this to customize the button order or fixate a certain set of buttons.

    Note

    The default arrays include PSPDFToolbarSeparatorButton and PSPDFToolbarSpacerButton objects.

    Declaration

    Objective-C

    - (nonnull NSArray<__kindof PSPDFToolbarButton *> *)buttonsForWidth:
        (CGFloat)width;

    Swift

    func buttons(forWidth width: CGFloat) -> [PSPDFToolbarButton]
  • This is called on size changes and when the free text accessory is deallocated. If you present your own controller, add custom logic here to ensure it’s dismissed.

    Declaration

    Objective-C

    - (void)dismissPresentedViewControllersAnimated:(BOOL)animated;

    Swift

    func dismissPresentedViewControllers(animated: Bool)