问题
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