|
Hi, When placing an order for e.g. 8 cupcakes in ContentView, then navigating through placing the order, when i receive the notification back from the server, it does not update the decodedOrder quantity correctly - but it reflects the right kind of cupcake..?? I have checked contentView, and I have made the binding correctly to quantity.
I also believe the data upload is also correct. Anyone have any ideas?
Thanks. |
|
How do you verify the object in one view is properly packaged and received by another view? Debugging TechniqueHere's a common technique you may want to consider. You may have structs or classes that contain strings, integers or booleans. Or all three! While you're developing and testing, you may want to just see the contents of an object. One way to consider is making your object conform to Here's a small code snip. Run this in Playgrounds and have fun.
Keep Coding!Please return here and let us know if this helped you zero in on the location of your bug? |
|
Hi there. Solved it. Forgot to add quantity to the codingKeys enum, which meant that it was not handled by the server.
|
BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.