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.