Skip to content

Instantly share code, notes, and snippets.

@AlexandrFadeev
Created January 19, 2021 08:19
Show Gist options
  • Save AlexandrFadeev/ade0f10fc89e4e65b5ae5e8bcbb5464c to your computer and use it in GitHub Desktop.
Save AlexandrFadeev/ade0f10fc89e4e65b5ae5e8bcbb5464c to your computer and use it in GitHub Desktop.
SwiftUI live preview for UIKit apps
#if DEBUG
import SwiftUI
struct <#ViewController#>Presentable: UIViewControllerRepresentable {
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {
}
@available(iOS 13.0, *)
func makeUIViewController(context: Context) -> UIViewController {
<#ViewController#>()
}
}
@available(iOS 13.0, *)
struct <#ViewController#>Preview: PreviewProvider {
static var previews: some View {
<#ViewController#>Presentable()
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment