I created a form and in that form is a textview where user's can type to report problems with the app. The problem is when the user clicks the return key it creates a line break [Line 2. in the image]. The textview text is stored in the text variable and is being passed to a url. I already am using replaceOccurences for spacing in between words. How would add \n to the line breaks created by the return key?
Thanks.
I want the text stored in database to look like this:
This is where text goes. Line break below \n this is after the return key...
@IBAction func send(_ sender: AnyObject){
let text = textView.text!
if(text.isEmpty){ Alert01("Please provide a brief description."); return }
let reportUrl = "http://www.appurl.com/report.php?id=\(userId)&message=\(text)"
let urlEncodedString = reportUrl.replacingOccurrences(of: " ", with: "%20")
parseJSON(url: urlEncodedString) }
}