Structure
ByteCountFormatStyle.Attributed
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A format style that converts byte counts into attributed strings.
struct Attributed
Overview
Use the attributed modifier on a ByteCountFormatStyle to create a format style of this type.
The attributed strings that this format style creates contain attributes from the AttributeScopes.FoundationAttributes.NumberFormatAttributes attribute scope. Use these attributes to determine which runs of the attributed string represent different parts of the formatted value.
Topics
Initializers
Instance Properties
var allowedUnits: ByteCountFormatStyle.UnitsThe units the format style can use to express the byte count.var includesActualByteCount: BoolA Boolean value that indicates whether the format style should include the exact byte count, in addition to expressing it in terms of units.var locale: LocaleThe locale to use to format the numeric part of the byte count.var spellsOutZero: BoolA Boolean value that indicates whether the format style should spell out zero-byte values as text.var style: ByteCountFormatStyle.StyleThe semantic style the format style uses to represent a byte count value.
Instance Methods
func format(Int64) -> AttributedStringFormats a numeric byte count, using this style.func locale(Locale) -> ByteCountFormatStyle.AttributedModifies the format style to use the specified locale.
Relationships
Conforms To
FormatStyleSwift.DecodableSwift.EncodableSwift.EquatableSwift.HashableSwift.SendableSwift.SendableMetatype