GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jamesmalcolmXDesign/DrawableView: A UIView subclass that allows the user to draw on it.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

71 Commits
71 Commits

Folders and files

NameName
Last commit message
Last commit date
DrawableView.xcodeproj
DrawableView.xcodeproj
 
 
DrawableView
DrawableView
 
 
DrawableViewExample
DrawableViewExample
 
 
DrawableViewTests
DrawableViewTests
 
 
.gitignore
.gitignore
 
 
DrawableView.podspec
DrawableView.podspec
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
drawing.gif
drawing.gif
 
 

Repository files navigation

DrawableView

A UIView subclass that allows the user to draw on it.

Swift Version License Carthage compatible CocoaPods Compatible
Platform PRs Welcome

Add a DrawableView to your app and you will immediately be able to draw on it. Then try changing the stroke color, width, and transparency!

Features

  • Stroke Color
  • Stroke Width
  • Stroke Transparency
  • Undo
  • DrawableViewDelegate
  • Quad Curve Interpolation

Requirements

  • iOS 9.0+
  • Xcode 8.3.1

Installation

CocoaPods

You can use CocoaPods to install DrawableView by adding it to your Podfile:

pod 'DrawableView'

Simply import DrawableView wherever you would like to use it.

import UIKit
import DrawableView

Carthage

Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/DrawableView.framework to an iOS project.

github "EthanSchatzline/DrawableView"

Usage example

class ViewController: UIViewController, DrawableViewDelegate {

    @IBOutlet var drawableView: DrawableView! {
      didSet {
        drawableView.delegate = self
        drawableView.strokeColor = .blue
        drawableView.strokeWidth = 12.0
        drawableView.transparency = 1.0
      }
    }

    func setDrawing(_ isDrawing: Bool) {
        /*
        Run some logic based on if the user is currently drawing a stroke or not.
        Commonly people hide the drawing tools UI while the user is drawing and fade it back in once they stop.
        */
    }

    func saveDrawingToPhotoLibrary() {
      guard let drawnImage = drawableView.image else { return }
      UIImageWriteToSavedPhotosAlbum(drawnImage, self, nil, nil)
    }
}

Contribute

We would love for you to contribute to DrawableView, check the LICENSE file for more info.

Meta

Ethan Schatzline – @_Easy_E – [email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/EthansShatzline/

About

A UIView subclass that allows the user to draw on it.

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.