A format style that converts byte counts into attributed strings.
Use the ``ByteCountFormatStyle/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.
Members (12)
get · iOS 15.0+
includesActualByteCount
TypeScript
get includesActualByteCount(): boolean
Swift declaration
var includesActualByteCount: Bool
A Boolean value that indicates whether the format style should include the exact byte count, in addition to expressing it in terms of units.
set · iOS 15.0+
includesActualByteCount
TypeScript
set includesActualByteCount(value: boolean)
Swift declaration
var includesActualByteCount: Bool
A Boolean value that indicates whether the format style should include the exact byte count, in addition to expressing it in terms of units.
get · iOS 15.0+
allowedUnits
TypeScript
get allowedUnits(): ByteCountFormatStyle_Units
Swift declaration
var allowedUnits: ByteCountFormatStyle.Units
The units the format style can use to express the byte count.
set · iOS 15.0+
allowedUnits
TypeScript
set allowedUnits(value: ByteCountFormatStyle_Units)
Swift declaration
var allowedUnits: ByteCountFormatStyle.Units
The units the format style can use to express the byte count.
get · iOS 15.0+
spellsOutZero
TypeScript
get spellsOutZero(): boolean
Swift declaration
var spellsOutZero: Bool
A Boolean value that indicates whether the format style should spell out zero-byte values as text.
set · iOS 15.0+
spellsOutZero
TypeScript
set spellsOutZero(value: boolean)
Swift declaration
var spellsOutZero: Bool
A Boolean value that indicates whether the format style should spell out zero-byte values as text.
get · iOS 15.0+
style
TypeScript
get style(): ByteCountFormatStyle_Style
Swift declaration
var style: ByteCountFormatStyle.Style
The semantic style the format style uses to represent a byte count value.
set · iOS 15.0+
style
TypeScript
set style(value: ByteCountFormatStyle_Style)
Swift declaration
var style: ByteCountFormatStyle.Style
The semantic style the format style uses to represent a byte count value.
method · iOS 15.0+
format
TypeScript
format(value: number): AttributedString
Swift declaration
func format(_ value: Int64) -> AttributedString
Formats a numeric byte count, using this style.
- Parameter value: The 64-bit byte count to format.
- Returns: A formatted attributed string representation of the byte count.
get · iOS 15.0+
locale
TypeScript
get locale(): Locale
Swift declaration
var locale: Locale
The locale to use to format the numeric part of the byte count.
set · iOS 15.0+
locale
TypeScript
set locale(value: Locale)
Swift declaration
var locale: Locale
The locale to use to format the numeric part of the byte count.
Modifies the format style to use the specified locale.
- Parameter locale: The locale to apply to the format style.
- Returns: A format style that uses the specified locale.