---
title: next()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/flattensequence/iterator/next()
---

# next()

Advances to the next element and returns it, or nil if no next element exists.

## Declaration

```swift
mutating func next() -> FlattenSequence<Base>.Iterator.Element?
```

## Discussion

Discussion Once nil has been returned, all subsequent calls return nil. note: next() has not been applied to a copy of self since the copy was made.
