Last active
October 3, 2022 01:56
-
-
Save ulitiy/b01a819eae23255880834da698379400 to your computer and use it in GitHub Desktop.
Use PencilKit PKCanvasView in SwiftUI example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView : View { | |
var body: some View { | |
PKCanvasRepresentation() | |
} | |
} | |
#if DEBUG | |
struct ContentView_Previews : PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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