One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

Text.DateStyle

struct · iOS 14.0+ · SDK 27.1

struct DateStyle

A predefined style used to display a `Date`.

Members (5)

get · iOS 14.0+

date

TypeScript
static get date(): Text_DateStyle
Swift declaration
static let date: Text.DateStyle

A style displaying a date. Text(event.startDate, style: .date) Example output: June 3, 2019

get · iOS 14.0+

time

TypeScript
static get time(): Text_DateStyle
Swift declaration
static let time: Text.DateStyle

A style displaying only the time component for a date. Text(event.startDate, style: .time) Example output: 11:23PM

get · iOS 14.0+

timer

TypeScript
static get timer(): Text_DateStyle
Swift declaration
static let timer: Text.DateStyle

A style displaying a date as timer counting from now. Text(event.startDate, style: .timer) Example output: 2:32 36:59:01

get · iOS 14.0+

offset

TypeScript
static get offset(): Text_DateStyle
Swift declaration
static let offset: Text.DateStyle

A style displaying a date as offset from now. Text(event.startDate, style: .offset) Example output: +2 hours -3 months

get · iOS 14.0+

relative

TypeScript
static get relative(): Text_DateStyle
Swift declaration
static let relative: Text.DateStyle

A style displaying a date as relative to now. Text(event.startDate, style: .relative) Example output: 2 hours, 23 minutes 1 year, 1 month

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →