NACCInitialViewController

class NACCInitialViewController : NACCBaseViewController
extension NACCInitialViewController: EKEventEditViewDelegate

This screen displays the date selector, and the textual cleantime report. This is the first screen to be shown.

Private Static Properties

  • This has the minimal screen height for viewing the logo.

    Declaration

    Swift

    private static let _minimumScreenHeight: CGFloat
  • The sizing coefficient to use. This compares against the screen size (center image “watermark”).

    Declaration

    Swift

    private static let _tagSizeCoefficient: CGFloat
  • The period that we use for the “fade in” animation.

    Declaration

    Swift

    private static let _fadeAnimationPeriod: CGFloat
  • The ID of a segue to show the tabs.

    Declaration

    Swift

    private static let _cleandateDisplaySegueID: String

Private Instance Properties

  • This will allow us to add events to the Calendar, without leaving this app.

    Declaration

    Swift

    private let _eventStore: EKEventStore
  • This stores the original logo height

    Declaration

    Swift

    private var _originalLogoHeight: CGFloat
  • This will contain the cleantime display for this screen. We set it at runtime.

    Declaration

    Swift

    private var _cleantimeDisplayView: LGV_UICleantimeImageViewBase?

Internal Instance IBOutlet Properties

  • This allows the tester to select a date.

    Declaration

    Swift

    @IBOutlet
    weak var dateSelector: UIDatePicker?
  • This displays a textual representation of the cleantime.

    Declaration

    Swift

    @IBOutlet
    weak var cleantimeReportLabel: UILabel?
  • This is where the cleantime view is shown, and centers it.

    Declaration

    Swift

    @IBOutlet
    weak var cleantimeViewContainer: UIView?
  • This button brings in the info screen.

    Declaration

    Swift

    @IBOutlet
    weak var infoButton: UIBarButtonItem?
  • This button allows us to create calendar events.

    Declaration

    Swift

    @IBOutlet
    weak var calendarButton: UIBarButtonItem?
  • This is a container view for the logo, at the top of the screen.

    Declaration

    Swift

    @IBOutlet
    weak var logoContainerView: UIView?
  • This is a switched-off constraint that collapses the medallion/keytag view, when the screen is a shorty.

    Declaration

    Swift

    @IBOutlet
    weak var cleantimeDisplayHeightConstraint: NSLayoutConstraint?
  • This does the same for the logo (but we use the constant, so it animates better).

    Declaration

    Swift

    @IBOutlet
    weak var logoHeightConstraint: NSLayoutConstraint?
  • This is the “Action Item” button (share, print, etc.).

    Declaration

    Swift

    @IBOutlet
    weak var actionButton: UIBarButtonItem?
  • The “startup” logo that we fade out.

    Declaration

    Swift

    @IBOutlet
    weak var startupLogo: UIImageView?

Instance Methods

  • Sets the date, first time through.

    If we pass in a date, then we ignore the prefs.

    Declaration

    Swift

    func setDate(_ inDate: Date? = nil, tabIndex inTabIndex: NACCTabBarController.TabIndexes? = nil)

    Parameters

    inDate

    The date to set. It’s optional. Don’t specify it to use the prefs.

    tabIndex

    The tab index to choose. This is optional. If not specified, we do not open a tab.

  • This handles the “fade in” animation. This only happens, the first time.

    Declaration

    Swift

    func fadeInAnimation()

Base Class Overrides

  • Called when the view hierarchy has been completed.

    Declaration

    Swift

    override func viewDidLoad()
  • Called just before the view appears. We use it to set the date picker date.

    Declaration

    Swift

    override func viewWillAppear(_ inIsAnimated: Bool)

    Parameters

    inIsAnimated

    True, if the appearance is to be animated.

  • Called when the subviews have been arranged.

    Declaration

    Swift

    override func viewDidLayoutSubviews()

Callbacks

  • If the report text is hit, we open to whatever tab was last selected.

    Declaration

    Swift

    @IBAction
    func textHit(_: Any)
  • If the logo is hit, we open to the keytag array tab

    Declaration

    Swift

    @IBAction
    func logoImageHit(_: Any)
  • If the medallion/keytag is hit, we open to medallions, if over a year, keytag array, otherwise.

    Declaration

    Swift

    @IBAction
    func medallionImageHit(_: Any)
  • When a new date is selected, we generate a new report.

    Declaration

    Swift

    @IBAction
    func newDate(_ inDatePicker: UIDatePicker! = nil)

    Parameters

    inDatePicker

    The picker instance. This can be ignored (in which case we try the date selector).

  • Called when the action item in the navbar is hit.

    Declaration

    Swift

    @IBAction
    func actionItemHit(_ inButtonItem: UIBarButtonItem)

    Parameters

    inButton

    The action item button.

  • Called when the calendar button is hit.

    See more

    Declaration

    Swift

    @IBAction
    func calendarButtonHit(_: UIBarButtonItem)

EKEventEditViewDelegate Conformance

  • Called when the even kit has completed with an action to add the reminder to the calendar.

    Declaration

    Swift

    func eventEditViewController(_ inController: EKEventEditViewController, didCompleteWith inAction: EKEventEditViewAction)

    Parameters

    inController

    The controller we’re talking about.

    didCompleteWith

    The even action that completed.