u/AnotherThrowAway_9in r/swift • Recommends
HackingWithSwift: 8 Common SwiftUI Mistakes – and how to fix them!
#swiftui#stateobject#observedobject
122K subscribers • 6 videos on Hallway
Intermediate. Assumes working knowledge.
52K views6 years ago1 recommendation
Mobile developmentTools and practiceSwiftiOS and SwiftUIDebugging
Paul Hudson explains eight frequent mistakes developers make when learning SwiftUI, from modifier ordering to state management, and how to resolve them.
SwiftUI is a big and complex framework, and although it’s great fun to work with there’s also a lot of scope for making mistakes. In this article I’m going to walk through 8 common mistakes SwiftUI learners make, and how to fix them. – Adding views and modifiers where they aren't needed – Using @ObservedObject when they mean @StateObject – Putting modifiers in the wrong order – Attaching property observers to property wrappers – Stroking shapes when you mean to stroke their border – Using alerts and sheets with optionals – Trying to get "behind" their SwiftUI views – Creating dynamic views with invalid rangesWhat people say. Recommended as an essential watch for avoiding common pitfalls and understanding state management in SwiftUI.
u/AnotherThrowAway_9in r/swift • Recommends