Skip to content

Instantly share code, notes, and snippets.

@Mercandj
Last active January 8, 2023 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mercandj/9dcff6a798eda205066b044610e3daa8 to your computer and use it in GitHub Desktop.
Save Mercandj/9dcff6a798eda205066b044610e3daa8 to your computer and use it in GitHub Desktop.
import UIKit
import SwiftUI // <-- Add SwiftUI import
class HelloWorldView: UIView {
// UIView code here
struct HelloWorldView_Preview: PreviewProvider { // <-- Add the preview definition
static var previews: some View {
Preview()
}
private struct Preview: UIViewRepresentable {
func makeUIView(context: Context) -> UIView {
HelloWorldView()
}
func updateUIView(_ uiView: UIViewType, context: Context) {
// Not needed
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment