DispatchTime and (NS)Date have the property distantFuture, which "returns a time in the distant future."
Discussion:
You can pass this value to methods that schedule work to have the system wait indefinitely for a particular event to occur or condition to be met.
I can't think of or find an example where I would actually need to use this. What is a good use case?
For example if you want to retrieve future events from a calendar with an unspecified end date.
In this case you can set the end date of the predicate to distantFuture.
Here's an example what unspecific dates will be returned:
let date = Date()
// current, here: "Sep 30, 2020 at 9:27 AM"
let distantPast = Date.distantPast
// "Jan 1, 1 at 12:53 AM"
let distantFuture = Date.distantFuture
// "Jan 1, 4001 at 1:00 AM"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With