isDate(_:inSameDayAs:)

Returns true if the given date is within the same day as another date, as defined by the calendar and calendar’s locale.

iOS
8.0+
macOS
10.10+
tvOS
9.0+
watchOS
2.0+
func isDate(_ date1: Date, inSameDayAs date2: Date) -> Bool

Parameters

date1

A date to check for containment.

date2

A date to check for containment.

Returns

true if date1 and date2 are in the same day.