https://github.com/randomtask2000/pencilkit
Pencilkit bindings for SwiftUI
https://github.com/randomtask2000/pencilkit
Last synced: 28 days ago
JSON representation
Pencilkit bindings for SwiftUI
- Host: GitHub
- URL: https://github.com/randomtask2000/pencilkit
- Owner: randomtask2000
- License: mit
- Created: 2021-02-01T18:09:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-27T16:35:09.000Z (over 6 years ago)
- Last Synced: 2025-01-23T08:44:14.437Z (about 1 year ago)
- Homepage: https://notemate.com
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PencilkitSwiftUI
[](https://travis-ci.org/notemate/Pencilkit)
[](https://cocoapods.org/pods/PencilkitSwiftUI)
[](https://cocoapods.org/pods/PencilkitSwiftUI)
[](https://cocoapods.org/pods/PencilkitSwiftUI)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
PencilkitSwiftUI is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'PencilkitSwiftUI'
```
## Example
```swift
import Combine
import SwiftUI
import PencilkitSwiftUI
struct EditorView: View {
@State var canvasChangeObservable = CurrentValueSubject(nil)
@State var canvasData: Data? = nil
var body: some View {
GeometryReader { reader in
PKCanvasRepresentation(observable: self.canvasChangeObservable, data: self.canvasData)
.frame(maxWidth: .infinity, idealHeight: reader.size.height, alignment: .topLeading)
.background(Color.white)
}
}
}
```
## Author
notemate, yagiznizipli@me.com
## License
PencilkitSwiftUI is available under the MIT license. See the LICENSE file for more info.