Frequently Asked Questions
-
What is UIKit Previews Generator?
UIKit Previews Generator is an Xcode Source Editor Extension that allows developers to quickly generate SwiftUI based previews for UIKit code.
While you could write all the boilerplate code yourself, it becomes a tedious task doing so for every UIKit subclass you write, more so if you're only inspecting a series of UIKit classes.
-
How do I use UIKit Previews Generator?
Select any file containing UIKit code and run the "Generate previews" command. All the boilerplate needed to wrap your UIKit code in SwiftUI and generate the previews will be added automatically. The only thing you will need to add is the instantiation code for your UIKit subclass!
-
Why do I still need to write the instantiation logic for my UIKit code?
The extension makes no assumptions about your code. Perhaps your view controller is partially defined on a Storyboard, or expects a view model to be properly initialized.
-
What UIKit subclasses are supportted?
UIKit Previews Generator can generate previews for subclasses of UIViewController, UIView, UITableViewCell, UICollectionViewCell and UITableViewHeaderFooterView.
Contact
If you have any questions, comments or suggestions please get in touch!