How to Debug a SwiftUI Preview Crash in Xcode Now

Опубликовано: 15 Октябрь 2024
на канале: Paul Solt
585
3

How do you make sense of a preview crash? How do you use the debugger in Xcode?

Debugging effectively in Xcode takes practice, so it helps to see how it works and learn from more experienced developers.
In this video I debug a problem where my index is going out of bounds and causing preview to crash randomly.

When you have more moving parts it can be harder to spot the problem. In this code, you can see how using the Published property with a binding is causing problems between the SwiftUI update loop and the data model it is representing.

#debugging #swiftUI #crash #ios #xcode #iosdeveloper #debug #lldb