Returns a closed range that contains both of its bounds.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 11.0+
Framework
- Dispatch
Declaration
static func ... (minimum: Dispatch Queue.Scheduler Time Type, maximum: Dispatch Queue.Scheduler Time Type) -> Closed Range<Dispatch Queue.Scheduler Time Type>
Parameters
minimum
The lower bound for the range.
maximum
The upper bound for the range.
Discussion
Use the closed range operator (...
) to create a closed range of any type that conforms to the Comparable
protocol. This example creates a Closed
from “a” up to, and including, “z”.
let lowercase = "a"..."z"
print(lowercase.contains("z"))
// Prints "true"