Prettier debug output printing Swift Dictionary in Xcode

后端 未结 2 537
隐瞒了意图╮
隐瞒了意图╮ 2021-02-14 22:29

When I use print() on a dictionary in Swift, it comes out nice and pretty in the console, with a key and a value.

object = Optional({
customerId = 1         


        
2条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 22:59

    expression debugPrint(object)
    

    just put the line above in your debugger and hit enter. It will print out contents of our object in more human readable format.

    also you can use another one command - po print(data), which is easier to remember.

提交回复
热议问题