Instance Method

value(for:)

Returns the value of one of the properties, using an enumeration value instead of a property name.

Declaration

func value(for component: Calendar.Component) -> Int?

Discussion

The calendar and timeZone and isLeapMonth property values cannot be retrieved by this method.

See Also

Accessing Calendar Components

func setValue(Int?, for: Calendar.Component)

Set the value of one of the properties, using an enumeration value instead of a property name.

enum Calendar.Component

An enumeration for the various components of a calendar date.