Introduction
The current calendar that views should use when handling dates.
Detailed design
importFoundationimportSwiftpublicstructCalendarKey : EnvironmentKey {public static var defaultValue:Calendar {
.current }
}
extensionEnvironmentValues {
/// The current calendar that views should use when handling dates.var calendar : Calendar {
get { self[CalendarKey.self] }
set { self[CalendarKey.self] = newValue }
}
}
Introduction
The current locale that views should use.
Detailed design
publicstructLocaleKey : EnvironmentKey {public static var defaultValue:Locale {
.current }
/// Returns a Boolean value indicating whether two values are equal.////// Equality is the inverse of inequality. For any values `a` and `b`,/// `a == b` implies that `a != b` is `false`.////// - Parameters:/// - lhs: A value to compare./// - rhs: Another value to compare.publicstaticfunc_valuesEqual(_lhs: Locale, _rhs: Locale) ->Bool {
lhs == rhs
}
}
extensionEnvironmentValues {
/// The current locale that views should use.var locale: Locale {
get { self[LocaleKey.self] }
set { self[LocaleKey.self] = newValue }
}
}```
</details>