<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSControl/selectedTag()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSControl(im)selectedTag"
  },
  "title" : "selectedTag()"
}
-->

# selectedTag()

Returns the tag of the receiver’s selected cell.

```
func selectedTag() -> Int
```

## Return Value

The tag of the selected cell, or `-1` if no cell is selected.

## Discussion

When you set the tag of a control with a single cell in Interface Builder, it sets the tags of both the control and the cell with the same value as a convenience.

## See Also

[`tag`](/documentation/AppKit/NSControl/tag)

The tag identifying the receiver (not the tag of the receiver’s cell).



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)