Alex Waldron

@alexwaldron
6 Followers
12 Following
4 Posts
Slowly falling in love with SwiftUI’s task modifier for async sequences; view scoped cancellation and automatic restarts with task(id:) … sign me up #swiftui
Slowly falling in love with SwiftUI’s task modifier for async sequences; view scoped cancellation and automatic restarts with task(id:) … sign me up #swiftui
Slowly falling in love with SwiftUI’s task modifier for async sequences; view scoped cancellation and automatic restarts with task(id:)… sign me up #swiftui
Slowly falling in love with SwiftUI’s task modifier for async sequences; view scoped cancellation and automatic restarts with task(id:)… sign me up #swiftui
Its because Date uses `timeIntervalSinceReferenceDate` internally so you can run into floating point rounding ... makes sense, just very surprising

TIL round tripping a `Foundation.Date` using epoch time can lose precision 🤷

let now = Date.now
#expect(now == Date(timeIntervalSince1970: now.timeIntervalSince1970)) // ❌

#swift