iOS HMPeriod

HMPeriod is used to define a time period between start and end dates.

Initialising

Initialises an HMPeriod object from start and end date

Declaration

init(start: Date, end: Date)

Parameters

start

(Date) start time of the period

end

(Date) end time of the period

Returns

HMPeriod

Example

import HMKit

let start: Date = Date(timeIntervalSinceNow: -10e3)
let end: Date = Date(timeIntervalSinceNow: 10e3)
let period: HMPeriod = HMPeriod(start: start, end: end)

Properties

.start

Declaration

init(start: Date, end: Date)

.end

Declaration

let end: Date

.isValid

Declaration

var isValid: (Date) -> Bool { get }

Parameters

input

(Date) to check belonging inside the period

Example

import HMKit

let date: Date = Date()
let period: HMPeriod = HMPeriod(...)
let isValid: Bool = period.isValid(date)