How to print call stack in Swift?

后端 未结 5 1634
野性不改
野性不改 2020-12-23 11:19

In Objective-C, you can print the call stack by doing the following:

NSLog(@\"%@\", [NSThread callStackSymbols]);

How do you do this in Swi

5条回答
  •  独厮守ぢ
    2020-12-23 11:46

    This improves the output a little.

    for symbol: String in NSThread.callStackSymbols() {
        NSLog("%@", symbol)
    }
    

提交回复
热议问题