Testing and Declarative UI's
summary
Argues for extracting decision logic out of views so business rules live in testable units (use an enum-mode and view model that is ObservableObject with @Published mode), exercises those units with plain unit tests, and wires Swift UI previews into automated visual checks by converting Xcode Previews into image snapshots via the SnapshotTesting workflow (hosting controller + preview-to-snapshot protocol). Notes navigation via NavigationLink driven by external state works but can be flaky.
AI-written summary · about
chapters (11)
- 0:00Testing and declarative UIs
- 2:15Testing in iOS development
- 3:22Testing declarative UIs
- 8:23Business logic in SwiftUI
- 10:30Dumb views and separation
- 11:57Navigation logic testing
- 15:51Xcode previews testing
- 18:21Visual regression automation
- 23:04Previews and snapshot tests
- 25:33Lessons from React
- 27:06Q&A
related talks
29mThe Magic of UI Testing
54mTest Driven Development (TDD) by Controlling Dependencies
37miOS Testing: Beyond the Model
23mUI Testing for Fun and Profit
28mAdvanced Techniques in iOS UI Testing
32mUI Automation with XCUITest
46mSqueezing Even More Out of SwiftUI Preview
32mVenturing Into the world of RxSwift unit testing
