llama.swiftui : add "Done" dismiss button to help view (#11998)

The commit updates the help view in the llama.swiftui example to use a
NavigationView and a Done button to dismiss the help view.

The motivation for this is that without this change there is now way to
dimiss the help view.
This commit is contained in:
Daniel Bevenius 2025-02-22 06:33:29 +01:00 committed by GitHub
parent 51f311e057
commit de8b5a3624
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,15 +124,26 @@ struct ContentView: View {
} }
} }
}.sheet(isPresented: $showingHelp) { // Sheet for help modal }.sheet(isPresented: $showingHelp) { // Sheet for help modal
VStack(alignment: .leading) { NavigationView {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text("1. Make sure the model is in GGUF Format") VStack(alignment: .leading) {
.padding() Text("1. Make sure the model is in GGUF Format")
Text("2. Copy the download link of the quantized model") .padding()
.padding() Text("2. Copy the download link of the quantized model")
.padding()
}
Spacer()
} }
Spacer() .navigationTitle("Help")
} .navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button("Done") {
showingHelp = false
}
}
}
}
} }
} }
} }