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
templateTemplate
String, instances of%@will be replaced. -
Formats pagination numbers using the
formatterand formatting the string using the giventemplate.Declaration
Swift
case customNumberFormat(template: String, formatter: NumberFormatter)Parameters
templateTemplate string where
$@is replacedformatterNumber 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) -> StringParameters
pageCurrent page
totalTotal amount of pages.
Return Value
Formatted
String -
nodoc
Declaration
Swift
public static func == (lhs: PDFPaginationStyle, rhs: PDFPaginationStyle) -> Bool
View on GitHub
Install in Dash