Initializerswift 6.0.3FoundationInternationalization->Swift
init(from:)
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
init(from decoder: any Decoder) throws
init(from decoder: any Decoder) throws
ss8DurationV30FoundationInternationalizationE16UnitsFormatStyleV10AttributedV4fromAGs7Decoder_p_tKcfc
What are these?50441
import Swift
import FoundationInternationalization
@dynamicMemberLookup struct Attributed
A format style to format a duration as an attributed string. Units in the string are annotated with the durationField
and measurement
attribute keys and the DurationFieldAttribute
and MeasurementAttribute
attribute values.
@frozen struct Duration
A representation of high precision time.
struct UnitsFormatStyle
A FormatStyle
that displays a duration as a list of duration units, such as “2 hours, 43 minutes, 26 seconds” in English.
protocol Decoder
A type that can decode values from a native format into in-memory representations.
subscript<T>(dynamicMember key: WritableKeyPath<Duration.UnitsFormatStyle, T>) -> T { get set }
subscript<T>(dynamicMember key: KeyPath<Duration.UnitsFormatStyle, T>) -> T { get }
func discreteInput(after input: Duration) -> Duration?
func discreteInput(before input: Duration) -> Duration?
func format(_ duration: Duration) -> AttributedString
Formats a duration as an attributed string with DurationFieldAttribute
.
func locale(_ locale: Locale) -> Duration.UnitsFormatStyle.Attributed
A modifier to set the locale of the format style.