NACCPagePrintRenderer

class NACCPagePrintRenderer : UIPrintPageRenderer

This class is a print renderer for the screens. It will create a formatted report, with the tag/medallion display, underneath. It is just 1 page.

  • We will reduce the font to a level that will display in the area provided. This is where we start.

    Declaration

    Swift

    let startingFontSize: CGFloat
  • This holds the string report, at the top of the page.

    Declaration

    Swift

    var cleantimeReport: String
  • This will hold the cleantime tag or medallion image, to be printed below the report.

    Declaration

    Swift

    var cleantimeImage: UIImage?
  • Initializer with the string and the image.

    Declaration

    Swift

    init(report inReportString: String, image inTagImage: UIImage?)

    Parameters

    report

    The string, containing the cleantime report.

    image

    The tag/medallion image displayed.

Base Class Override Calculated Instance Properties

  • Declaration

    Swift

    override var numberOfPages: Int { get }

    Return Value

    1 (always)

Base Class Override Methods

  • This will draw out the report page, with the report in the top quarter, and the image in the bottom.

    Declaration

    Swift

    override func drawContentForPage(at: Int, in inContentRect: CGRect)

    Parameters

    at

    The page number (ignored).

    in

    The content destination context rect.

Instance Methods

  • Draw the text report.

    Declaration

    Swift

    func drawReport(in inContentRect: CGRect)

    Parameters

    in

    This is the display rect.

  • Draw the image

    Declaration

    Swift

    func drawImage(_ inImage: UIImage, in inContentRect: CGRect)

    Parameters

    inImage

    The image to be drawn.

    in

    This is the display rect.