<!--
{
  "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/CSUserQueryContext/init(currentSuggestion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSUserQueryContext(cm)userQueryContextWithCurrentSuggestion:"
  },
  "title" : "init(currentSuggestion:)"
}
-->

# init(currentSuggestion:)

Creates a new query context object with an optional suggested search string.

```
init(currentSuggestion: CSSuggestion?)
```

## Parameters

`currentSuggestion`

The suggested text completion that the person
selected in your interface. Specify `nil` if the person hasn’t
chosen a suggestion.

## Return Value

An initialized user query context object. Configure the properties
of the returned object and use it to construct a [`CSUserQuery`](/documentation/CoreSpotlight/CSUserQuery) object.

---

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)