BarryBostwick
BarryBostwick

Reputation: 940

How do I debug my iOS app with Swift

I started building my first iOS app and I am trying to debug it. I set a break point on my viewDidLoad() function (line 14) like so: enter image description here

When I run the app and the get the ViewController to load, my debugger view opens in xcode but I am getting this (what looks like assembly code) view. enter image description here

I can't seem to figure out how to view the debugger in my Swift code and be able to step through it in Swift. Does anyone know how to accomplish this? Thanks!

Upvotes: 4

Views: 1861

Answers (2)

BarryBostwick
BarryBostwick

Reputation: 940

I found the issue.

Debug > Debug Workflow > "Always Show Disassembly" was checked off. Unchecking this now shows my source code when debugging.

Upvotes: 3

Garret
Garret

Reputation: 1147

You should set the breakpoint on a line of code inside the method and not the call to the super class. Then you'll be able to analyze variables at the breakpoint.

Upvotes: -1

Related Questions