How to Print Array in Label?

Viewed 7924

I'm trying to print my Array into my label but I don't found any way to do that.

Here is my array.

var lapTime: [[Double]] = [[]]

And there is where I put something of cool in my label

let str = NSString(format: "%.2f", rows[indexPath.row]["time"]! as! Double)
let arr = ??? // Here I Want to put my array
cell?.textLabel?.text = "\(indexPath.row + 1) -> \(str) -> \(arr)"

Thank you for your help !

4 Answers

In swift 4.1 and Xcode 9.4.1

My array is like this....

array = ["BELT", "BUNKER", "CABLES/ACCESSORIES ", "CABLE", "CHUTES", "GOLD"]
lbl.text = array.joined(separator: ",")

Output is :

enter image description here

Related