Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmetkgunay/drawpathview
Drawable View with any colors you want to fill and can be erased last path or all paths anytime
https://github.com/ahmetkgunay/drawpathview
drawable drawing fill swift4
Last synced: 2 months ago
JSON representation
Drawable View with any colors you want to fill and can be erased last path or all paths anytime
- Host: GitHub
- URL: https://github.com/ahmetkgunay/drawpathview
- Owner: ahmetkgunay
- License: mit
- Created: 2015-12-16T09:45:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T16:22:13.000Z (about 7 years ago)
- Last Synced: 2024-03-14T20:04:46.272Z (9 months ago)
- Topics: drawable, drawing, fill, swift4
- Language: Swift
- Size: 5.61 MB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DrawPathView
[![Version](https://img.shields.io/cocoapods/v/DrawPathView.svg?style=flat)](http://cocoapods.org/pods/DrawPathView)
[![License](https://img.shields.io/cocoapods/l/DrawPathView.svg?style=flat)](http://cocoapods.org/pods/DrawPathView)
[![Platform](https://img.shields.io/cocoapods/p/DrawPathView.svg?style=flat)](http://cocoapods.org/pods/DrawPathView)Drawable View with any colors you want to fill and can be erased last path or all paths anytime
![Anim](https://github.com/ahmetkgunay/DrawPathView/blob/master/anim.gif)
## Usage
Usage is simple, you can just add as a subview DrawPathView which is inheritted from UIView to any Custom view.
```swift
lazy var drawView : DrawPathView = {
let dv = DrawPathView(frame: self.view.bounds)
dv.lineWidth = 10.0
dv.delegate = self
return dv
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(drawView)
}
```User also can delete paths as last drawn path or all paths at the same time.
```swift
internal func eraseLast() {
drawView.clearLast()
}
internal func eraseAll() {
drawView.clearAll()
}
```
#### DelegatesDrawPathView has also two delegate methods :
- viewDrawStartedDrawing : Calls when user started drawing
- viewDrawEndedDrawing : Calls when user ended drawing```swift
// MARK: - DrawPathView Delegate -
func viewDrawStartedDrawing() {
print("Started Drawing")
}
func viewDrawEndedDrawing() {
print("Ended Drawing")
}```
## Requirements
## Installation
DrawPathView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "DrawPathView"
```## Author
Ahmet Kazım Günay, [email protected]
## License
DrawPathView is available under the MIT license. See the LICENSE file for more info.