isDateInWeekend(_:)

Returns true if the given date is within a weekend period, as defined by the calendar and calendar’s locale.

iOS
8.0+
macOS
10.10+
tvOS
9.0+
watchOS
2.0+
func isDateInWeekend(_ date: Date) -> Bool

Parameters

date

The specified date.

Returns

true if the given date is within a weekend.