Xcode Playground Timeline empty

前端 未结 2 1789
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-19 09:31

I am trying to use the timeline assistant editor for playground in xcode version 7.3.1, it is always empty. Timeline assistant editor

I think the error is from xcode

2条回答
  •  无人及你
    2021-01-19 10:00

    To display the result of print you need to open the "debug area" by going to menu

    View > Debug Area > Show Debug Area

    or click on the button in the lower left part:

    To display the timeline graph, you could use XCPCaptureValue:

    import XCPlayground
    
    var x = 0
    for i in 0...10 {
        x += i
        print(x)
        XCPCaptureValue("Value for x", value: x)   
    }
    

    but XCPCaptureValue has been deprecated and won't be available in the future (there's no available replacement).

    The alternative is to display the graph inline by clicking on the "+" button on the right:

    Do a right click on the graphs and you can choose to display value history instead:

提交回复
热议问题