ShiftDetail

@objc(ZDShiftDetail)
public final class ShiftDetail : NSObject

Represents a shift comprising of shift intervals over the week.

  • The name of the shift.

    Declaration

    Swift

    @objc
    public var shiftName: String?
  • The unique identifer used to identify a shift.

    Declaration

    Swift

    @objc
    public var shiftId: String
  • A Timezone object which specifies the timezone of the shift.

    Declaration

    Swift

    @objc
    public var timezone: TimeZone
  • Shift intervals specify the intervals when the SDK should be active.

    Declaration

    Swift

    @objc
    public var shiftIntervals: [ShiftInterval]
  • Initialize the shift details object with shiftName, shiftId, timezone and shiftIntervals.

    Declaration

    Swift

    @objc
    public init(shiftName: String?, shiftId: String, timezone: TimeZone, shiftIntervals: [ShiftInterval])
  • Returns a dictionary format of the shiftDetail object. This function can be used for printing the shift details returned by the SDK. Example:

    ["shift_name": "morning_shift",
    "timezone": "America/Los_Angeles",
    "shift_intervals":
    [
        [
            "start_time": [
            "day_of_week": "Monday",
            "time": "11:00 AM"
            ],
            "end_time": [
                "day_of_week": "Monday",
                "time": "02:00 PM"
            ]
        ]
    ],
    "shift_id": "zendrive_shift_1"]
    

    Declaration

    Swift

    @objc
    public func toDictionary() -> [String : Any]?