Skip to content

Instantly share code, notes, and snippets.

@ulitiy
Last active October 3, 2022 01:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulitiy/b01a819eae23255880834da698379400 to your computer and use it in GitHub Desktop.
Save ulitiy/b01a819eae23255880834da698379400 to your computer and use it in GitHub Desktop.
Use PencilKit PKCanvasView in SwiftUI example
import SwiftUI
struct ContentView : View {
var body: some View {
PKCanvasRepresentation()
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
import SwiftUI
import PencilKit
struct PKCanvasRepresentation : UIViewRepresentable {
func makeUIView(context: Context) -> PKCanvasView {
return PKCanvasView();
}
func updateUIView(_ uiView: PKCanvasView, context: Context) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment