PDFList

public class PDFList : PDFDocumentObject
extension PDFList: CustomDebugStringConvertible
extension PDFList: CustomStringConvertible

Creates a new bullet list or numbered list with multiple, indented levels.

Each list item has a pre spacing between the page indentation to the left side of the symbol, and a past spacing at the right side of the symbol.

 let list = PDFList(indentations: [(pre: 0.0, past: 20.0), (pre: 20.0, past: 20.0), (pre: 40.0, past: 20.0)])
  • Items in this list

    Declaration

    Swift

    public var items: [PDFListItem]
  • Spacing before and after the symbol for each nesting level

    Declaration

    Swift

    public var levelIndentations: [(pre: CGFloat, past: CGFloat)]
  • Creates a new list

    Declaration

    Swift

    public init(indentations: [(pre: CGFloat, past: CGFloat)])

    Parameters

    indentations

    Spacing before and after the symbol for each nesting level. If not enough indentation levels are provided, the default value 0 will be used for pre and past.

  • Adds the given item to this list

    Declaration

    Swift

    @discardableResult
    public func addItem(_ item: PDFListItem) -> PDFList

    Parameters

    item

    Item to add

    Return Value

    Reference to this instance, useful for chaining

  • Appends the given items to this list

    Declaration

    Swift

    @discardableResult
    public func addItems(_ items: [PDFListItem]) -> PDFList

    Parameters

    items

    Items to append

    Return Value

    Reference to this instance, useful for chaining

  • Count of items in this list

    Declaration

    Swift

    public var count: Int { get }
  • Converts the added instances of PDFListItem from a nested structure into an array of tuples

    Declaration

    Swift

    public func flatted() -> [(level: Int, text: String, symbol: PDFListItemSymbol)]

    Return Value

    Array of tuples with level, text and symbol for each item

Equatable

Hashable

  • nodoc

    Declaration

    Swift

    override public func hash(into hasher: inout Hasher)

CustomDebugStringConvertible

  • nodoc

    Declaration

    Swift

    public var debugDescription: String { get }

CustomStringConvertible

  • nodoc

    Declaration

    Swift

    public var description: String { get }