---
title: nextSpan()
framework: Swift
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: swift/span/borrowingiterator/nextspan()
---

# nextSpan()

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

## Declaration

```swift
@export(implementation) mutating func nextSpan() throws(Self.Failure) -> Span<Self.Element>
```
