I put a defer inside a do, like so
do {
defer {
self.captureSession?.commitConfiguration()
print("commitConfiguration")
}
self.captureSession?.beginConfiguration()
// try a bunch AV session setup calls
...
}
catch {
// error
}
I tried to put a break point to ensure the defer block is stepped into at the end. To my surprise, it didn't. I checked documentation, ran the app, nothing is seemingly wrong. So I put a print statement. Lo and behold, it did print it, showing it probably did execute even though debug breakpoint never got activated.
Anyone observed this in Xcode 10.1 High Sierra ?
Yes, I noticed exactly the same thing. If memory serves it was at work using Xcode 9.4 and High Sierra. The defer fires, but the breakpoint doesn't break.
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