---
title: "#53: Signatures with Jot 🖋"
url: https://littlebitesofcocoa.com/53-signatures-with-jot
author: Jake Marsh
date: 2015-08-05
published: 2015-08-05
topics: ["Libraries"]
description: "Jot is an awesome library from Laura Skelton and the team at IFTTT. It makes it easy to add drawing and text overlay capabilities to your app."
---

# #53: Signatures with Jot 🖋

By Jake Marsh, August 5, 2015. HTML: https://littlebitesofcocoa.com/53-signatures-with-jot

[Jot](http://git.io/jot) is an awesome library from [Laura Skelton](https://github.com/lauraskelton) and the team at [IFTTT](https://github.com/IFTTT). 

It makes it easy to add drawing and text overlay capabilities to your app. Today we're going to use it to build a view controller that will allow our users to sign their name on the screen using their finger. Let's get started.

We start with the "Single View" template and `import jot`.

We instantiate a new `JotViewController`, and add it as a *child view controller* of our `SignatureViewController`. We'll do this inside `viewDidLoad`:

``` swift
class SignatureViewController: UIViewController {
  var jotViewController: JotViewController?

  override func viewDidLoad() {
    super.viewDidLoad()

    jotViewController = JotViewController()
    addChildViewController(jotViewController!)

    view.addSubview(jotViewController!.view)
    jotViewController!.didMoveToParentViewController(self)
    jotViewController!.view.frame = view.frame
  }
}
```

Now comes the fun part. We set the `JotViewController's` state to be `.Drawing` and its drawing color to *black*:

``` swift
jotViewController!.drawingColor = UIColor.blackColor()
jotViewController!.state = .Drawing
```

If you launch the app now, you'll see you can now sign your name on the screen!

We finish things off with a *Done* button and some instructions. Finally, we can grab the image of the signature like this:

``` swift
jotViewController!.renderImageOnColor(UIColor.whiteColor())
```

<img src="https://media.littlebitesofcocoa.com/bite-assets/053-signatures-with-jot-final-product.png" style="max-width: 514px;">

Download the final project here: [j.mp/bite053](http://j.mp/bite053)

More info about Jot can be found at [git.io/jot](http://git.io/jot)
