Skip to content

Instantly share code, notes, and snippets.

View esnssr's full-sized avatar

Eslam Nasser esnssr

View GitHub Profile
@esnssr
esnssr / FormatStyle Example
Created December 5, 2025 12:15
FormatStyle
public extension FormatStyle where Self == TimeFormatStyle<FloatingPointFormatStyle<Double>> {
static var time: TimeFormatStyle<FloatingPointFormatStyle<Double>> {
TimeFormatStyle(baseStyle: .number, countDirection: nil, formatter: .timeFormatter)
}
static func time(formatter: DateComponentsFormatter) -> TimeFormatStyle<FloatingPointFormatStyle<Double>> {
TimeFormatStyle(baseStyle: .number, countDirection: nil, formatter: formatter)
}