PDFPaginationStyle

public enum PDFPaginationStyle
extension PDFPaginationStyle: Equatable

Use predefined pagination styles or create a custom one, using .CustomNumberFormat or .CustomClosure.

Enums using a template String as parameter will replace the first instance of %@ with the index and the second one with the total amount of pages.

  • Default format, concats current page and total pages with a dash.

    e.g. Converts page 1 of 3 to “1 - 3”

    Declaration

    Swift

    case `default`
  • Returns pagination in roman numerals.

    Declaration

    Swift

    case roman(template: String)

    Parameters

    template

    Template String, instances of %@ will be replaced.

  • Formats pagination numbers using the formatter and formatting the string using the given template.

    Declaration

    Swift

    case customNumberFormat(template: String, formatter: NumberFormatter)

    Parameters

    template

    Template string where $@ is replaced

    formatter

    Number formatter

  • Formats the pagination using the provided closure

    Declaration

    Swift

    case customClosure(PDFPaginationClosure)
  • Creates formatted pagination string.

    Declaration

    Swift

    public func format(page: Int, total: Int) -> String

    Parameters

    page

    Current page

    total

    Total amount of pages.

    Return Value

    Formatted String

  • nodoc

    Declaration

    Swift

    public static func == (lhs: PDFPaginationStyle, rhs: PDFPaginationStyle) -> Bool