<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/BorrowingIteratorProtocol",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s25BorrowingIteratorProtocolP"
  },
  "title" : "BorrowingIteratorProtocol"
}
-->

# BorrowingIteratorProtocol

A type that provides borrowed access to the values of a borrowing sequence.

```
protocol BorrowingIteratorProtocol<Element, Failure> : ~Copyable, ~Escapable
```

## Topics

### Associated Types

[`associatedtype Element : ~Copyable`](/documentation/Swift/BorrowingIteratorProtocol/Element)

[`associatedtype Failure : Error = Never`](/documentation/Swift/BorrowingIteratorProtocol/Failure)

### Instance Methods

[`func nextSpan() throws(Self.Failure) -> Span<Self.Element>`](/documentation/Swift/BorrowingIteratorProtocol/nextSpan())

Returns a span over the next group of elements that are ready to by visited,
up to the specifed maximum.

[`func nextSpan(maxCount: Int) throws(Self.Failure) -> Span<Self.Element>`](/documentation/Swift/BorrowingIteratorProtocol/nextSpan(maxCount:))

Returns a span over the next group of elements that are ready to by visited,
up to the specifed maximum.

[`func skip(by: Int) throws(Self.Failure) -> Int`](/documentation/Swift/BorrowingIteratorProtocol/skip(by:))

Advances the position of this iterator by the specified offset, or until
the end of the underlying type’s elements.

## Relationships

### Conforming Types

[`BorrowingIteratorAdapter`](/documentation/Swift/BorrowingIteratorAdapter)

[`BorrowingIterator`](/documentation/Swift/Span/BorrowingIterator)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)