Переглядів 49,126
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.
1:48 - Adding views and modifiers where they aren't needed
4:05 - Using @ObservedObject when they mean @StateObject
6:38 - Putting modifiers in the wrong order
12:29 - Attaching property observers to property wrappers
16:20 - Stroking shapes when you mean to stroke their border
19:19 - Using alerts and sheets with optionals
22:36 - Trying to get "behind" their SwiftUI views
25:03 - Creating dynamic views with invalid ranges