---
title: selectedTag()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nscontrol/selectedtag()
---

# selectedTag()

Returns the tag of the receiver’s selected cell.

## Declaration

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

## Return Value

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

## Discussion

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

### Related Documentation

- [tag](appkit/nscontrol/tag.md)

### Deprecated Methods

- [selectedCell()](appkit/nscontrol/selectedcell().md)
- [setNeedsDisplay()](appkit/nscontrol/setneedsdisplay().md)
- [calcSize()](appkit/nscontrol/calcsize().md)
- [selectCell(_:)](appkit/nscontrol/selectcell(_:).md)
- [drawCell(_:)](appkit/nscontrol/drawcell(_:).md)
- [drawCellInside(_:)](appkit/nscontrol/drawcellinside(_:).md)
- [updateCell(_:)](appkit/nscontrol/updatecell(_:).md)
- [updateCellInside(_:)](appkit/nscontrol/updatecellinside(_:).md)
