NACCPagePrintRenderer
@MainActor
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
@MainActor let startingFontSize: CGFloat -
This holds the string report, at the top of the page.
Declaration
Swift
@MainActor var cleantimeReport: String -
This will hold the cleantime tag or medallion image, to be printed below the report.
Declaration
Swift
@MainActor var cleantimeImage: UIImage? -
Initializer with the string and the image.
Declaration
Swift
@MainActor init(report inReportString: String, image inTagImage: UIImage?)Parameters
reportThe string, containing the cleantime report.
imageThe tag/medallion image displayed.
-
Declaration
Swift
@MainActor override var numberOfPages: Int { get }Return Value
1 (always)
-
This will draw out the report page, with the report in the top quarter, and the image in the bottom.
Declaration
Swift
@MainActor override func drawContentForPage(at: Int, in inContentRect: CGRect)Parameters
atThe page number (ignored).
inThe content destination context rect.
-
Draw the text report.
Declaration
Swift
@MainActor func drawReport(in inContentRect: CGRect)Parameters
inThis is the display rect.
-
Draw the image
Declaration
Swift
@MainActor func drawImage(_ inImage: UIImage, in inContentRect: CGRect)Parameters
inImageThe image to be drawn.
inThis is the display rect.
View on GitHub