<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSuggestion",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSSuggestion"
  },
  "title" : "CSSuggestion"
}
-->

# CSSuggestion

The kind of suggestion to use in a query.

```
class CSSuggestion
```

## Overview

Your app uses `CSSuggestion` objects to populate a contextual menu of suggestions.

## Topics

### Setting suggestion attributes

[`localizedAttributedSuggestion`](/documentation/CoreSpotlight/CSSuggestion/localizedAttributedSuggestion-3ssly)

An attributed string for the localized suggestion.

[`suggestionKind`](/documentation/CoreSpotlight/CSSuggestion/suggestionKind-swift.property)

The type of suggestion.

[`SuggestionKind`](/documentation/CoreSpotlight/CSSuggestion/SuggestionKind-swift.enum)

The suggestion type that determines how the system handles a suggestion.

### Comparing suggestions

[`-  compare:`](/documentation/CoreSpotlight/CSSuggestion/compare(_:))

Compares the suggestion with a second specified suggestion.

[`-  compareByRank:`](/documentation/CoreSpotlight/CSSuggestion/compare(byRank:))

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

---

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)