Configuration

Swift

public struct Configuration : Hashable

Configuration options for SignatureCreationViewController.

See example usage at https://pspdfkit.com/guides/ios/signatures/customizing-the-signature-user-interface/

  • The default signature colors the user can pick from.

    This property is used as a default argument value for the initializer of this type and is not recommended for any other uses.

    Declaration

    Swift

    public static let defaultColors: [UIColor]
  • The default signature fonts the user can pick from.

    This property is used as a default argument value for the initializer of this type and is not recommended for any other uses.

    Declaration

    Swift

    public static let defaultFonts: [UIFont]
  • The ways in which the user can choose to add their signature.

    These are shown in the order specified as tabs across the top of the signatures UI. The first entry will be selected initially. If this array contains a single entry then the tabs will be hidden. This array must not be empty and must not contain duplicates.

    Defaults to [.draw, .image, .type].

    Declaration

    Swift

    public var availableModes: [Mode]
  • The available colors that the user can pick for their signature when drawing or typing.

    The first entry will be selected initially. If this array contains a single entry then the color options will be hidden. This array must not be empty and must not contain duplicates.

    Limiting this to no more than around three colors is recommended.

    Defaults to black, purple, and blue.

    Declaration

    Swift

    public var colors: [UIColor]
  • Whether natural drawing is enabled, which applies thickness adjustments based on the speed of strokes. Only relevant with the Draw mode. Defaults to true.

    Declaration

    Swift

    public var isNaturalDrawingEnabled: Bool
  • Font options presented to the user for the Type mode to set their signature style. Defaults to 4 custom fonts that are bundled by PSPDFKit. The size of the provided UIFont instances is ignored. This array must not be empty.

    Declaration

    Swift

    public var fonts: [UIFont]
  • Declaration

    Swift

    public init(availableModes: [Mode] = [.draw, .image, .type], colors: [UIColor] = defaultColors, isNaturalDrawingEnabled: Bool = true, fonts: [UIFont] = defaultFonts)