Swift playground with debugger support?

≡放荡痞女 提交于 2020-01-03 19:01:35

问题


Swift playgrounds in Xcode 7 don't seem to support usage of the debugger. This features seems like it would be (extremely) useful ...

I've got a playground that exercises code within a framework I'm writing. I'd really love to be able to set a breakpoint on the code within my framework -- and have the debugger stop execution when the breakpoint is hit when the code is executed from a playground. Does anyone know why playgrounds don't currently support this? Is there some fundamental reason why a playground couldn't support this or might this be a feature that could come in the future?


回答1:


There is no debugger in the Playground in Xcode. However in the right of the code, you should see the value of each expression when that line of code is executed. If it is executed multiple times, you’ll just see "(X times)”, but you can click the blue dot and see the values over time, either as a graph or a list.

If you want to print out values with the default print("") expression, make sure that you enable the assistant editor:

View > Assistant editor > Show Assistant editor



来源:https://stackoverflow.com/questions/34186805/swift-playground-with-debugger-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!