---
title: next()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/utf8span/unicodescalariterator/next()
---

# next()

Decode and return the scalar starting at currentCodeUnitOffset. After the function returns, currentCodeUnitOffset holds the position at the end of the returned scalar, which is also the start of the next scalar.

## Declaration

```swift
mutating func next() -> Unicode.Scalar?
```

## Discussion

Discussion Returns nil if at the end of the UTF8Span. note: O(1)
