• Stars
    star
    1,775
  • Rank 25,574 (Top 0.6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An iOS framework for easily adding drawings and text to images.

Open Source at IFTTT

jot Logo

CocoaPods Version Build Status Coverage Status

jot is an easy way to add touch-controlled drawings and text to images in your iOS app.

FastttCamera

What's jot for?

Annotating Images

jot is the easiest way to add annotations to images with a touch interface. You can draw arrows or circle important things, as well as add resizable, rotatable text captions, and easily save the notes on top of a image using drawOnImage:.

Whiteboard or Drawing Apps

jot is perfect for quick sketches and notes in your whiteboard or drawing app. It's easy to change the drawing color or stroke width, and when you're done, you can call renderImageOnColor: to save the sketch.

Signatures

jot is a great solution if you need to collect user signatures through a touch interface. Set the drawingColor to black, set the state to JotViewStateDrawing, and save the signature when the user is done by calling renderImageOnColor:.

Installation

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

pod "jot"

Example Project

To run the example project, clone the repo, and run pod install from the Example directory.

Usage

Add an instance of JotViewController as a child of your view controller. Adjust the size and layout of JotViewController 's view however you'd like.

#import "ExampleViewController.h"
#import <jot/jot.h>

@interface ExampleViewController ()
@property (nonatomic, strong) JotViewController *jotViewController;
@end

@implementation ExampleViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    _jotViewController = [JotViewController new];
    self.jotViewController.delegate = self;
    
    [self addChildViewController:self.jotViewController];
    [self.view addSubview:self.jotViewController.view];
    [self.jotViewController didMoveToParentViewController:self];
    self.jotViewController.view.frame = self.view.frame;
}

Switch between drawing, text manipulation, and text edit mode.

- (void)switchToDrawMode
{
	self.jotViewController.state = JotViewStateDrawing;
}

- (void)switchToTextMode
{
	self.jotViewController.state = JotViewStateText;
}

- (void)switchToTextEditMode
{
	self.jotViewController.state = JotViewStateEditingText;
}

Clear the drawing.

// Clears text and drawing
[self.jotViewController clearAll];

// Clears only text
[self.jotViewController clearText];

// Clears only drawing
[self.jotViewController clearDrawing];

Image Output

Draw on a background image.

- (UIImage *)imageWithDrawing
{
	UIImage *myImage = self.imageView.image;
	return [self.jotViewController drawOnImage:myImage];
}

Draw on a color.

- (UIImage *)imageOnColorWithDrawing
{
	UIColor *backgroundColor = self.view.backgroundColor;
	return [self.jotViewController renderImageOnColor:backgroundColor];
}

Draw on a transparent background.

- (UIImage *)imageOnColorWithDrawing
{
	UIColor *backgroundColor = self.view.backgroundColor;
	return [self.jotViewController renderImage];
}

Basic Configuration

Text Settings

Change the font.

self.jotViewController.font = [UIFont boldSystemFontOfSize:64.f];

Change the font size.

self.jotViewController.fontSize = 64.f;

Change the text color.

self.jotViewController.textColor = [UIColor redColor];

Set the initial text string.

self.jotViewController.textString = @"Hello World";

Drawing Settings

Change the drawing stroke color.

self.jotViewController.drawingColor = [UIColor magentaColor];

Change the drawing stroke width.

self.jotViewController.drawingStrokeWidth = 10.f;

Make the drawing stroke a constant width, instead of the default dynamically variable width.

self.jotViewController.drawingConstantStrokeWidth = YES;

Advanced Configuration

Text Settings

Set the text to wrap to the width of the view.

self.jotViewController.fitOriginalFontSizeToViewWidth = YES;

Set the text alignment (only applies if text is set to wrap).

self.jotViewController.textAlignment = NSTextAlignmentRight;

Set the text insets (only applies if text is set to wrap).

self.jotViewController.initialTextInsets = UIEdgeInsetsMake(10.f, 10.f, 10.f, 10.f);

Set the text editing insets.

self.jotViewController.textEditingInsets = UIEdgeInsetsMake(10.f, 10.f, 10.f, 10.f);

Set the text edit view to clip text to the text editing insets (instead of fading out with a gradient).

self.jotViewController.clipBoundsToEditingInsets = YES;

Contributors

License

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

Copyright 2015 IFTTT Inc.

More Repositories

1

JazzHands

A simple keyframe-based animation framework for UIKit. Perfect for scrolling app intros.
Objective-C
6,419
star
2

RazzleDazzle

A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros.
Swift
3,361
star
3

FastttCamera

Fasttt and easy camera framework for iOS with customizable filters
Objective-C
1,853
star
4

polo

Polo travels through your database and creates sample snapshots so you can work with real world data in development.
Ruby
758
star
5

SparkleMotion

A ViewPager animator that animates Views within pages as well as views across pages.
Java
340
star
6

IFTTTLaunchImage

Put your asset catalog launch images to work for you.
Objective-C
310
star
7

kashmir

Kashmir is a Ruby DSL that makes serializing and caching objects a snap.
Ruby
266
star
8

tablerize

Say goodbye to aligning tables in Markdown.
Ruby
40
star
9

ConnectSDK-Android

Android SDK for Connect API
Java
23
star
10

connect_with_ifttt_auth_sample

A fake OAuth2 server, mobile API and IFTTT Channel to demonstrate how to implement the server side portion of the Connect with IFTTT SDK.
JavaScript
20
star
11

ConnectSDK-iOS

Connect Button SDK for iOS
Swift
17
star
12

redshift_runner

Ruby gem to query AWS Redshift
Ruby
15
star
13

kramdown-tablerize

Use Tablerize to convert YAML tables in Markdown to HTML.
Ruby
7
star
14

heroku_line_item_billing

Ruby
5
star
15

stripe-webhook-event-ingester

An AWS CDK-based project for ingesting Stripe webhook events into an SQS queue
Python
4
star
16

service-api

OpenAPI definition for IFTTT Service API
HTML
4
star
17

memoize_via_cache

Ruby
4
star
18

pool-shard

Pools of sharded PostgreSQL database connections.
CoffeeScript
4
star
19

elb-tool

Go
2
star
20

delayed_job_shim_for_resque

Ruby
2
star
21

getting-started-with-connect

Getting Started with IFTTT Connect
Python
2
star
22

github_channel_test

1
star
23

3d-logo

IFTTT logo, suitable for 3D printing
OpenSCAD
1
star
24

engineering-handbook

1
star