<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/ColumnSlice/distinct()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData11ColumnSliceVAASHRzlE8distinctAA013DiscontiguouscD0VyxGyF"
  },
  "title" : "distinct()"
}
-->

# distinct()

Generates a discontiguous slice that contains unique elements.

```
func distinct() -> DiscontiguousColumnSlice<WrappedElement>
```

## Return Value

A discontiguous column slice.

## Discussion

The method only adds the first of multiple elements with the same value
— the element with the smallest index —
to the slice.

---

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)