format(_:)
Creates a locale-aware string representation from a duration value.
Declaration
func format(_ value: Duration) -> StringParameters
- value:
The duration value to format.
Return Value
A string representation of the duration, according to the style’s pattern and locale.
Discussion
Use this method when you want to create a format style and repeatedly use it to format different durations. For one-off cases with default formatting, call the formatted(_:) method of Duration instead.