Breakpoints are not being triggered during debugging. I discovered it's because of optimised code.
How can you disable optimisation?
I've walked through every toolbar and the closest option that I could find is Product => Perform Action => Generate Optimisation Profile
.
This does not work as I am debugging in the simulator, says Xcode.
Is it possible to disable code optimisation in Xcode 6.1 using the simulator and writing in Swift, and if so, how would I go about that?
SOLUTION:
My problem was finding the build settings menu in the first place.
Swift provides three different optimization levels: -Onone : This is meant for normal development. It performs minimal optimizations and preserves all debug info. -O : This is meant for most production code. The compiler performs aggressive optimizations that can drastically change the type and amount of emitted code.
In Xcode, look under 'Build Settings' for your target, scroll to 'Swift Compiler - Code Generation' and then 'Optimization Level'. Ensure that 'None' is selected.
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