NACC_Entry

struct NACC_Entry : TimelineEntry

This is one data entry for the widget. There will only be one, and it should reflect the current state.

  • This is how big we want our images to be, in display units.

    Declaration

    Swift

    private static let _imageSizeInDisplayUnits: CGFloat
  • The entry date (used to determine whether or not to display). This is always set to Date.now

    Declaration

    Swift

    var date: Date
  • The cleandate. This should reflect the date selected in the main app, and is used to determine the display.

    Declaration

    Swift

    var cleanDate: Date
  • If true, then we should not display medallions. Ignored, if onlyText is true.

    Declaration

    Swift

    var forceKeytag: Bool
  • If true, then no image should be shown; only the text report.

    Declaration

    Swift

    var onlyText: Bool
  • The text report.

    Declaration

    Swift

    var text: String
  • If true, then the keytag is yellow, and the gradient is not shown.

    Declaration

    Swift

    var yellowTag: Bool
  • If true, the gradient is not shown (regardless of the selected tag).

    Declaration

    Swift

    var dontShowBackground: Bool
  • The image that represents a keytag. May be nil. Mutually exclusive with singleMedallion.

    Declaration

    Swift

    var singleKeytag: UIImage?
  • The image that represents a medallion. May be nil. Mutually exclusive with singleKeytag.

    Declaration

    Swift

    var singleMedallion: UIImage?
  • This renders the images and text.

    This should be called on the main thread.

    Declaration

    Swift

    mutating func synchronize()
  • Default initializer

    Declaration

    Swift

    init(date inDate: Date = .now,
         cleanDate inCleandate: Date = .now.addingTimeInterval(-86400), // Give them a day
         forceKeytag inForceKeytag: Bool = true,
         onlyText inOnlyText: Bool = false,
         dontShowBackground inDontShowBackground: Bool = true
    )

    Parameters

    date

    The entry date (used to determine whether or not to display). This is always set to Date.now

    cleanDate

    The cleandate. This should reflect the date selected in the main app, and is used to determine the display.

    forceKeytag

    If true, then medallions will not be displayed.

    onlyText

    If true, then no image is shown; only the text report.

    dontShowBackground

    If true, then the yellow gradient background will NOT be shown.