Declarative Previews!
A rewrite from the ground up, your UIKit previews are now defined from a SwiftUI-inspired DSL.
Replicating a complex in-app design has never been easier, whether the screen you're previewing should show tab bars, large navigation bars, back buttons, toolbars, or all of them at once!
Simply declare how the preview should look…
struct YourViewController_Previews: PreviewProvider {
static var previews: some View {
TabBarControllerPreview(selectedIndex: 1) {
PreviewBlankTabItem(title: "First", symbolNamed: "capsule")
NavigationControllerPreview(barStyle: .largeTitle, showsToolbar: true) {
YourViewController()
YourViewController()
}
PreviewBlankTabItem(title: "Third", symbolNamed: "diamond")
}
.ignoresSafeArea(.all)
}
}
…and let PreviewView do the rest