Breakpoint not being triggered

I'm starting with a blank iOS App project with the following code:

Code Block
class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        testMethodB()
    }
    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        
        print("called: traitCollectionDidChange")
        testMethodA()
    }
    
    
    func testMethodA() {
    }
    
    func testMethodB() {
    }
}



I have breakpoints on line 17 traitCollecitonDidChange, line 21 (print), line 31 and line 36.

The breakpoint on line 36 gets called but the breakpoints on 17, 21, 23 and 31 aren't getting called even though the print line on 21 prints. I can't work out why these breakpoints aren't working. I'm running in debug mode, have cleared DerivedData, reinstalled Xcode amongst other things...

Have you tried tapping the breakpoints to enable/disable them. The only time I have had a breakpoint not work is when it is disabled, especially since your print method is firing. Another thing to try is "Clean Build Folder" under the "Product" menu, even though you did mention that you cleared the Derived Data.

Also don't forget to call super.traitCollectionDidChange(previousTraitCollection) after your override func. Even though the default method for traitCollectionDidChange is empty, if you have views higher up in your hierarchy, they need a chance to respond to the method as well.

Curious what you find out and what suggestions others may have.
Tried that and not working. I have logged a defect with Apple in the meantime. It seems that when using the Accessibility Inspector to make Font Size changes, then traitCollectionDidChange continues to be called (as it is with Environment Overrides) but the difference is that with the Accessibility Inspector, the breakpoint is triggered.
Breakpoint not being triggered
 
 
Q