---
title: "hasTag(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/containervalues/hastag(_:)"
---

# hasTag(_:)

Returns true if the container values contain a tag matching a given value.

## Declaration

```swift
func hasTag<V>(_ tag: V) -> Bool where V : Hashable
```

## Parameters

- `tag`: The tag value to check for.

## Return Value

Return Value If the container values has a tag matching the given value.

## Discussion

Discussion Tag values are set using the View/tag modifier.
