A swift library to parse call stack symbol supporting iOS, tvOS, watchOS, and macOS. Most of all source codes are ported from GDXRepo/CallStackParser. The version on this repository is added multiple platform support, support for Carthage and Cocoapods.
CallStackParser supports multiple platforms
- iOS 9.0 or later
- macOS 10.10 or later
- tvOS 9.0 or later
- watchOS 2.0 or later
- Swift 4.2
Add the following to your Cartfile
and follow these instructions.
github "gumob/CallStackParser"
To integrate CallStackParser into your project, add the following to your Podfile
.
pod 'CallStackParser'
Print simplified call stack symbols:
import CallStackParser
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
foo()
}
func foo() {
bar()
}
func bar() {
print(Thread.simpleCallStackString)
// [CallStack:3/3] ViewController bar()
// [CallStack:2/3] ViewController foo()
// [CallStack:1/3] ViewController viewDidLoad()
}
}
Read the API reference, or check example projects for detailed information.
CallStackParser is released under MIT license, which means you can modify it, redistribute it or use it however you like.