I want to share several values ​​in the form of a table through activityViewController, so it was nice, something like this ... enter image description here

And it turns out just one by one columns down. There are three parameters that store values ​​in arrays.

let name = ["Андрей", "Виктор", "Сергей", "Олег"] let weight = ["60", "70", "80", "90"] let height = ["160", "170", "180", "190"] let people = String(format: "Были три товарища: \n Имя Вес Рост\n%@", arguments: [name.joined(separator: "\n"), weight.joined(separator: "\n"), height.joined(separator: "\n")]) let activityViewController: UIActivityViewController = UIActivityViewController(activityItems: [people], applicationActivities: nil) self.present(activityViewController, animated: true, completion: nil) 

    1 answer 1

    You have a wrong string format:

     arguments: [name.joined(separator: "\n"), weight.joined(separator: "\n"), height.joined(separator: "\n")] 

    After each value you add a transition to the new line "\ n" . it must be added only after the last element in the line (weight).