Files
Graham Lee 9ead8781d4 Add .docc catalog to publish stdlib docs on swift.org
Co-authored-by: Alex Martini <amartini@apple.com>
Co-authored-by: Graham Lee <glee23@apple.com>
Co-authored-by: Chris Adamson <cadamson@apple.com>
Co-authored-by: Kirby Turner <kirby_turner@apple.com>
Co-authored-by: Paris Pinkney <ppinkney@apple.com>
Co-authored-by: Dave Spector <dspector@apple.com>
Co-authored-by: Sofia Rodriguez Morales <sofia_rodriguez@apple.com>
Co-authored-by: Ethan Kusters <ekusters@apple.com>
Co-authored-by: Goli Mohammadi <g_mohammadi@apple.com>
Co-authored-by: Adora Vaz <a_vaz@apple.com>
Co-authored-by: David Rönnqvist <ronnqvist@apple.com>
Co-authored-by: Nate Merseth Cook <natecook@apple.com>
Co-authored-by: Susan Conant <susan_c@apple.com>
2026-04-10 10:04:56 -04:00

1.2 KiB

Swift/ClosedRange

Topics

Creating a Range

Create a new range using the closed range operator (...).

  • Swift/Comparable/...(_:_:)

Converting Ranges

  • Swift/ClosedRange/relative(to:)

Inspecting a Range

  • Swift/ClosedRange/isEmpty
  • Swift/ClosedRange/lowerBound
  • Swift/ClosedRange/upperBound

Checking for Containment

  • Swift/ClosedRange/contains(_:)-(Bound)
  • Swift/ClosedRange/contains(_:)-(ClosedRange<Bound>)
  • Swift/ClosedRange/contains(_:)-(Range<Bound>)
  • Swift/ClosedRange/~=(_:_:)

Clamping a Range

  • Swift/ClosedRange/clamped(to:)

Comparing Ranges

  • Swift/ClosedRange/==(_:_:)
  • Swift/ClosedRange/!=(_:_:)
  • Swift/ClosedRange/overlaps(_:)-947dt
  • Swift/ClosedRange/overlaps(_:)-7dfep

Manipulating Indices

  • Swift/ClosedRange/hash(into:)

Describing a Range

  • Swift/ClosedRange/description
  • Swift/ClosedRange/debugDescription
  • Swift/ClosedRange/customMirror

Encoding and Decoding a Range

  • Swift/ClosedRange/encode(to:)
  • Swift/ClosedRange/init(from:)

Infrequently Used Functionality

  • Swift/ClosedRange/init(uncheckedBounds:)