ChatGPT_Chatbot
ChatGPT_Chatbot copied to clipboard
Copy/Paste
Currently, it is not possible to copy text bubbles within the app. It would be helpful to have the ability to copy both specific pieces of text within ChatGPT's replies and the entire chat bubbles themselves.
Edit (Jan 13, 2022):
I found a solution to this. Add ".textSelection(.enabled)" under Text(message.text)
struct MessageRow: View {
var message: Message
var body: some View {
HStack {
if message.isFromUser {
Spacer()
Text(message.text)
.textSelection(.enabled)
.padding(10)
.background(Color("AccentColor"))
.foregroundColor(.white)
.clipShape(RoundedRectangle(cornerRadius: 10))
.padding(.horizontal, 10)
.padding(.vertical, 5)
} else {
ScrollView {
Text(message.text).italic(message.isResponding)
.textSelection(.enabled)
.lineLimit(1...)
.padding(10)
.background(Color(.systemGray6))
.clipShape(RoundedRectangle(cornerRadius: 10))
.padding(.horizontal, 10)
.padding(.vertical, 5)
}
Spacer()
}
}
}
}
Would you like to submit a pull request? You can fork the repository, create a new branch to address the issue, and then make a pull request to merge your changes back into the main repository.