Debug Print in Swift (iOS)

Debug Print shows the instance representation that is most suitable for debugging.

print("Hello")
debugPrint("Hello")let dict = ["foo": 1, "bar": 2]print(dict)
debugPrint(dict)

Yields

>>> Hello
>>> "Hello"
>>> [foo: 1, bar: 2]
>>> ["foo": 1, "bar": 2]

This extra information can be very important, for example:

let wordArray = ["foo", "bar", "food, bars"]print(wordArray)
debugPrint(wordArray)

Yields

>>> [foo, bar, food, bars]
>>>…