<!--
{
  "availability" : [
    "iOS: 17.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JournalingSuggestions",
  "identifier" : "/documentation/JournalingSuggestions/JournalingSuggestionsPicker/init(_:onCompletion:)-4e82p",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Journaling Suggestions",
      "JournalingSuggestions"
    ],
    "preciseIdentifier" : "s:21JournalingSuggestions0aB6PickerVAA7SwiftUI4TextVRszrlE_12onCompletionACyAFGqd___yAA0A10SuggestionVYactcSyRd__lufc"
  },
  "title" : "init(_:onCompletion:)"
}
-->

# init(_:onCompletion:)

Creates a suggestions picker with button text defined by the given string.

```
@MainActor @preconcurrency init<S>(_ title: S, onCompletion: @escaping (JournalingSuggestion) async -> Void) where S : StringProtocol
```

## Parameters

`title`

A string that describes the suggestion picker’s purpose in the context of your app.

`onCompletion`

Code that you supply, which processes any suggestions that a person chooses in the picker.

## Discussion

This initializer creates a text view on your behalf and uses the string argument to set its text.

---

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)