---
title: viewID
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/scrollposition/viewid
---

# viewID

The type-erased id of the view positioned in the scroll view if configured to be in that position or the user has scrolled past a view with an id of matching type.

## Declaration

```swift
var viewID: (any Hashable & Sendable)? { get }
```
