mokacoding

unit and acceptance testing, automation, productivity

Posts tagged "swiftui"

How to write unit tests for SwiftUI apps

To test SwiftUI applications, don't test SwiftUI code. The SwiftUI framework doesn't lend itself to writing unit tests so don't try to shoehorn views in your test harness. Instead, split layout declaration form content generation logic.

How to migrate from SwiftUI to UIKit App Delegate Life Cycle in Xcode

This free tutorial shows how to migrate an existing app with SwiftUI life cycle to use UIKit App Delegate instead

How to bypass the SwiftUI App when running unit tests

How to make the unit tests of your SwiftUI app safer and faster by preventing them from running the program startup flow. This will avoid all of the launch operations like network requests or reads from the local storage that would affect the global state.

How to make the View to ViewModel relationship clear

Using Swift's nested types helps making it clear that a view model belongs to a view.