TimeInstance

class TimeInstance

This class holds the timer value as hours, minutes and seconds.

  • The number of hours in this instance, from 0 - 23

    Declaration

    Swift

    private var _hours: Int
  • The number of minutes in this instance, from 0 - 59

    Declaration

    Swift

    private var _minutes: Int
  • The number of seconds in this instance, from 0 - 59

    Declaration

    Swift

    private var _seconds: Int
  • This sets/returns the value of this class, as a total sum of seconds (0 - 86399)

    Declaration

    Swift

    var intVal: Int { get set }
  • Public accessor for the hours.

    Declaration

    Swift

    var hours: Int { get set }

    Return Value

    The hours (0 - 23)

  • Public accessor for the minutes.

    Declaration

    Swift

    var minutes: Int { get set }

    Return Value

    The minutes (0 - 59)

  • Public accessor for the seconds.

    Declaration

    Swift

    var seconds: Int { get set }

    Return Value

    The seconds (0 - 59)

  • Declaration

    Swift

    var dateComponents: DateComponents { get set }

    Return Value

    the value of the instance as DateComponents, for easy use in date calculations.

  • Returns the value in an easily readable format.

    Declaration

    Swift

    var description: String { get }
  • Initialize just like a tuple.

    Declaration

    Swift

    init(hours: Int, minutes: Int, seconds: Int)

    Parameters

    hours

    The number of hours, as an Int, from 0 - 23.

    minutes

    The number of minutes, as an Int, from 0 - 59.

    seconds

    The number of seconds, as an Int, from 0 - 59.

  • Initialize from total seconds.

    Declaration

    Swift

    init(_ inSeconds: Int)

    Parameters

    inSeconds

    The number of seconds as an Int, from 0 - 86399.