Skip to content

Instantly share code, notes, and snippets.

@treastrain
Created March 26, 2023 17:37
Show Gist options
  • Save treastrain/1e4a28b3c2db23348a0d634521c13d38 to your computer and use it in GitHub Desktop.
Save treastrain/1e4a28b3c2db23348a0d634521c13d38 to your computer and use it in GitHub Desktop.
Swift Foundation's `FormatStyle`

in Swift, use formatted methods directly on the types you want to format, optionally using FormatStyle and its subtypes to customize formatter output. This approach supports dates, integers, floating-point numbers, measurements, sequences, and person name components. Foundation caches identically-configured formatter instances internally, allowing you to focus on your app’s formatting needs.

Data Formatting | Apple Developer Documentation https://developer.apple.com/documentation/foundation/data_formatting

Numbers and Currency

Names

Dates and Times

Data Sizes

Measurements

Lists

Others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment