Monday Dec 23, 2019
SwiftUI is an incredible technology for building UI that is going to drastically change the way we build iOS applications. In UIKit we manage views by coordinating a bunch of mutable objects, but SwiftUI allows us to avoid all of those messy details by providing a declarative framework that lets us simply describe the view hierarchy.
However, since we are still in the early days of this technology, it is not yet clear how we are supposed to test a SwiftUI application. Almost everything that happens in a SwiftUI
View is hidden from us, and so it can be hard to make assertions on logic that is happening inside the view.
Luckily there’s a very simple way to get broad test coverage on any SwiftUI view today, and it’s done using the snapshot testing library we open sourced one year ago!
If you find any of this interesting, hop on over to our 100% free episode demonstrating how all of this (and more) is possible!
👋 Hey there! If you got this far, then you must have enjoyed this post. You may want to also check out Point-Free, a video series on functional programming and Swift.