Giter Site home page Giter Site logo

fastdraw's Introduction

Cocoapods

FastDraw

A Fast and Complete Swift Drawing(Handwriting) Library

Description

FastDraw is a high performance and highly extensible Drawing(Handwriting) Library that supports Apple Pencil.

Features

  • pencil and highlighter, color and width selection
  • eraser
  • lasso
  • export to sqlite, pdf, png

Here is a the demo of FastDraw

FastDrawDemo.mov

Getting Started

Add a basic DrawBoard

import UIKit
import FastDraw

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let drawboardview = DrawBoardView(frame: CGRect(origin: CGPoint(x: 0, y: 100),
                                                    size: view.frame.size))
        drawboardview.setupDrawing()
        self.view.addSubview(drawboardview)
    }
}

Update Brush type and color anywhere you like

import UIKit
import FastDraw

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let drawboardview = DrawBoardView(frame: CGRect(origin: CGPoint(x: 0, y: 100),
                                                    size: view.frame.size))
        drawboardview.setupDrawing()
        self.view.addSubview(drawboardview)
        Brush.shared.type = .pen
        Brush.shared.color = .red
        Brush.shared.width = 10
    }
}

Try out the FastDrawDemo

Try the app powered by FastDraw CoCreate.

Installation

CocoaPods

Create Podfile and add pod FastDraw:

use_frameworks!

target 'YourApp' do
    pod 'FastDraw'
end

Install pods:

pod install

Usage

Export to PDF/Image

// drawboardview is a view you have setup before

// export current drawing to URL
drawboardview.drawPDF(url: URL)
drawboardview.drawImage(url: URL)

// export current drawing to URL with background
// use these methods if you have provided a pdf as background of the UIView
drawboardview.drawPDF(pdfpage: CGPDFPage, url: URL)
drawboardview.drawImage(pdfpage: CGPDFPage, url: URL)

Help

Send me an email and I will answer your question and fix problem for you as soon as possible, or you can create an issue if you meet any problems

Contribution

Contribution is always welcomed! You can create an issue or pull request if you found a bug/implement a new feature/willing to improve the doc.

Roadmap

  • Toolbox to set brush
  • Stresstest function for FastDrawDemo
  • Improve performance of drawing
  • Documentation

Authors

Collin Zhang

License

MIT

fastdraw's People

Contributors

collinzrj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.