What’s New in Swift 5.7, WWDC 22
Great new features await us with Swift 5.7. Here is a list of all the improvements and changes to Swift announced during WWDC22.
Great new features await us with Swift 5.7. Some are enhancements to Swift, while others are enhancements and improvements to make it easier for us to write code.
In this article, we will examine the innovations that come with Swift 5.7 with examples.
Clock, Instant and Duration
Swift announces the innovations it offers to make time and duration management more stable in the SE-0329 section.
Clock
Clocks represent a way of measuring time passing. There are two built in: the continuous clock keeps incrementing time even when the system is asleep, and the suspending clock does not.
SuspendedClock
- Measuring device time
- Delays for animations
ContinuesClock
- Measuring human time
- Delays by an absolute duration
Instant
Instants represent an exact moment in time. Instants are there to be used to compare moments.
Duration
Duration can be used to represent the time elapsed between two Instant.
The original article is on AppCircle.io’s blog. Click here to read more.