I'm trying to add a breakpoint in the line # gutter, but no breakpoint is added when I do this in the playground. Is this possible or is there another way to set breakpoints in the playground?
Handling exceptions. One limitation of both the Xcode and iPad versions of Swift playgrounds is the lack of debugger support.
To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
If the thrown error has a helpful error message, that may be enough information to resolve the problem. If not, add a Swift error breakpoint to pause on the line that throws the error. In the Breakpoint navigator, click the Add button (+) in the lower-left corner, and choose Swift Error Breakpoint.
Customize what Xcode displays when running your app in the debugger by choosing Xcode > Preferences > Behaviors > Running. Use the buttons in the debug bar to control the execution of your app. Continue normal execution from the paused position until the app stops at the next breakpoint with the Continue button.
There's no debugger so you can't add any breakpoints.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With