Latest 1.0.0
Homepage https://github.com/Dingo203/fishPaint
License MIT
Platforms ios 8.0, requires ARC
Authors

fishPaint

Platform: iOS 8+Xcode: 8.0+
Language: Swift 3


CocoaPods compatible

Overview

FishPaint is a lightweight framework that offers a paint view for user written in Swift. FishPaint is built by using Core Gaphics.

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3.0

Installation

Cocoapods:

FishPaint is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "fishPaint"

Manual Installation:

Simply copy the contents of the ‘Class’ folder into your project.

Demo Screen Shot

Usage

Getting Started:

Simply create a fishPaintView and add it to your View Controller:

let paintView = fishPaintView(frame: self.view.frame)
self.view.addSubview(paintView)

By default, the view will automatically respond to touch gestures and begin drawing. The default line color is black.

Customization properties:

You can customization the properties for the fishPaintView, like drawingEnabled,lineWidth,lineOpacity,lineColor:

paintView.drawingEnabled = false
paintView.lineWidth = CGFloat(12.0)
paintView.lineOpacity = CGFloat(1.0)
paintView.lineColor = UIColor.white

Edit action:

FishPaint can let user to delete the last line segment. Simply call the removeLastLine function:

paintView.removeLastLine()

If you wish to clear the whole canvas, simply call the clearCanvas function:

paintView.clearCanvas()

Delegate

FishPaint offers delegate functions to response user’s reaction with a fishPaintView. To access these delegate methods, simply add your View Controller as the fishPaintViewDelegate:

class ViewController: UIViewController, fishPaintViewDelegate

There are four optional delegate methods:

func fishPaintDidBeginDrawing(view: fishPaintView)

func fishPaintIsDrawing(view: fishPaintView)

func fishPaintDidFinishDrawing(view: fishPaintView)

func fishPaintDidCancelDrawing(view: fishPaintView)

License

FishPaint is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "fishPaint",
    "version": "1.0.0",
    "summary": "A easy view for fish to paint",
    "description": "fishPaint provide swifty way to paint.",
    "homepage": "https://github.com/Dingo203/fishPaint",
    "license": "MIT",
    "authors": {
        "Dingo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Dingo203/fishPaint.git",
        "tag": "1.0.0"
    },
    "source_files": "fishPaint/Class/*.{h,m,swift}",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This