I created @IBAction , in which I registered the UIActivityViewController .

 @IBAction func shareButton(_ sender: Any) { let text1 = "Перевод величины Годы в количестве \(year) лет." let text2 = "Месяцы: \(mounthLabel.text!)" let text3 = "Недели: \(weekLabel.text!)" let text4 = "Дни: \(dayLabel.text!)" let text5 = "Часы: \(hourLabel.text!)" let text6 = "Минуты: \(minuteLabel.text!)" let text7 = "Секунды: \(secundLabel.text!)" let URL0 = "Скачать конвертер величин по ссылке:" let URL = "https://itunes.apple.com/us/app/unit-converter/id1329406653?l=ru&ls=1&mt=8" let space = "" let space2 = "" let activityController = UIActivityViewController(activityItems: [text1, space, text2, text3, text4, text5, text6, text7, space2, URL0, URL], applicationActivities: nil) present(activityController, animated: true, completion: nil) } 

Everything works fine, but when exporting to the application, the staffing "Notes" only saves the first line of text1 . What could be wrong and is there a way to fix it?

  • UPD. In Vkontakte he sends the full text. In the message too. Messengers and Facebook also write only the 1st line - Ivan Kisin

1 answer 1

try this:

 @IBAction func shareButton(_ sender: Any) { let text1 = "Перевод величины Годы в количестве \(year) лет." let text2 = "Месяцы: \(mounthLabel.text!)" let text3 = "Недели: \(weekLabel.text!)" let text4 = "Дни: \(dayLabel.text!)" let text5 = "Часы: \(hourLabel.text!)" let text6 = "Минуты: \(minuteLabel.text!)" let text7 = "Секунды: \(secundLabel.text!)" let URL0 = "Скачать конвертер величин по ссылке:" let URL = "https://itunes.apple.com/us/app/unit-converter/id1329406653?l=ru&ls=1&mt=8" let allText = text1 + "\n" + text2 + "\n" + text3 + "\n" + text4 + "\n" + text5 + "\n" + text6 + "\n" + text7 + "\n" + URL0 + "\n" + URL let activityController = UIActivityViewController(activityItems: [allText], applicationActivities: nil) present(activityController, animated: true, completion: nil) }