How do I list (po) the contents of a Swift Array? How do I list (po) the contents of a Swift Array? swift swift

How do I list (po) the contents of a Swift Array?


Just do:

po print(myStringArray)


You should be able to take advantage of the Printable or DebugPrintable protocols. Simply print out the description or debugDescription property:

po myStringArray.descriptionpo myStringArray.debugDescription


po myStringArray.map{ $0 }

if you have an array of custom objects

po myArray.map.{ $0.customProperty }