TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

Related tags

Image TextDrawer
Overview

TextDrawer

Swift 2.0 Version Status license MIT Carthage compatible

TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage.

About

Annotating Images

TextDrawer is the easiest way to add text to UIImage with a touch interface. You can add text, with resizable, move, and rotate gesture with UIGestureRecognizer. With TextDrawer, it's easily save notes on top of a UIImage.

ScreenShot

Requirements

  • iOS 8
  • Swift 1.2

Installation

CocoaPods

use_frameworks!
pod 'TextDrawer', '~> 1.0.6'

Carthage

github "remirobert/TextDrawer"

Manually

  1. Clone this repo and add the TextDrawer/TextDrawer.xcodeproj to your project
  2. Select your project app target "Build Phases" tab
  3. Add the TextDrawer.framework to the "Link Binary With Libraries"
  4. Create a new build phase of type "Copy Files" and set the "Destination" to "Frameworks"
  5. Add the TextDrawer.framework and check "Code Sign On Copy"

For an example, see the demo project included in this repo. To run the example project, clone the repo, and run pod install from the Example directory.

Getting Started

import TextDrawer
Design

This framework is composed on different parts. The first one is the TextEditView. It allows you to edit the text. it is composed of a UITextView, and manage the keyboard notifications. Next, DrawTextView, is a UIView, showing your text in the view. And, TextDrawer, it contains the above views. It allows to configure some parameter (like font, size, color, etc ...). All the gestures are managed here.

Usage

Add an instance of TextDrawer above an UIImageView, or an another UIView (with an optional clear background). Adjust the size and layout of TextDrawer however you'd like. TextDrawer uses, Masonry to manage auto-layout. You don't have anything to do, after that. TextDrawer will handle, the gesture for you. See this screen bellow.

screen shot 2015-07-21 at 14 37 45

Render the TextDrawer to an UIImage outup:

// draw the TextDrawer view on an UIImageView
let image = drawTextView.renderTextOnView(imageViewBackground)

// render the TextDrawer View to UIImage
let image = drawTextView.render()

// render the TextDrawer View directly on an UIImage
let image = drawTextView.renderTextOnImage(image)

Clear the TextDrawer view:

self.textDrawer.clearText()
self.textDrawer.resetTransformation()

TextDrawer configuration:

drawTextView.font = UIFont.systemFontOfSize(34)
drawTextView.textColor = UIColor.whiteColor()
drawTextView.textAlignement = NSTextAlignment.Center
drawTextView.textBackgroundColor = UIColor.redColor()
drawTextView.text = "test input"
drawTextView.textSize = 40

Contributors

License

TextDrawer is released under an MIT License. See LICENSE for details.

Copyright © 2015 Rémi ROBERT.

Please provide attribution, it is greatly appreciated.

You might also like...
WhiteAndFluffyTest - Scroll images and add them to your favourites via image page
WhiteAndFluffyTest - Scroll images and add them to your favourites via image page

Image service application Scroll images and add them to your favourites via imag

CachedAsyncImage is the simplest way to add cache to your AsyncImage.

SwiftUI CachedAsyncImage 🗃️ CachedAsyncImage is AsyncImage, but with cache capabilities. Usage CachedAsyncImage has the exact same API and behavior a

A Xcode plugin to add highlight to the instances of selected symbol.
A Xcode plugin to add highlight to the instances of selected symbol.

Auto Highlight Symbol About Xcode 8 Xcode 8 does't support plugins anymore, but there is a workaround, use at your own risk. Xcode can highlight insta

NavigationCoordinator acts as a coordinator for NavigationView in SwiftUI. You can use pushView, popView, popToView, popToRootView as you can in traditional UIKit

NavigationCoordinator NavigationCoordinator acts as a coordinator for NavigationView. You can use pushView, popView, popToView, popToRootView in Swift

Pipable is an iOS library to implement Picture in Picture for any UIView.
Pipable is an iOS library to implement Picture in Picture for any UIView.

Pipable Pipable is an iOS library to implement Picture in Picture for any UIView. This is done just by conforming to a protocol. The "Audio, AirPlay a

Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.
Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.

Welcome to Interactive Image View, a simple library that provides an easier way to interact with image view, like scroll, zoom and crop. In its core i

Kanvas is an open-source iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.
Kanvas is an open-source iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.

Kanvas Kanvas is an open-source iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.

A beautiful and flexible text field control implementation of
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

SkyFloatingLabelTextField SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern"

Mobile Text-to-Image search powered by multimodal semantic representation models(e.g., OpenAI's CLIP)
Mobile Text-to-Image search powered by multimodal semantic representation models(e.g., OpenAI's CLIP)

A Mobile Text-to-Image Search Powered by AI A minimal demo demonstrating semantic multimodal text-to-image search using pretrained vision-language mod

Comments
  • part of the rendered image is redundant

    part of the rendered image is redundant

    Hi, I have a imageView in my project and I render some text on the imageView' image. As the imageView 's mode is "aspect fit" (and the image didn't fill it), it has some spare space. And the rendered image keep these redundant space which I don't want.You can have a look at the screenshot below.

    Will TextDrawer cause the issue? Or I did something wrong? 2016-04-10 10 54 51

    opened by Textcat 2
  • fix error

    fix error

    If quit TextEditView without making any change, the size of DrawTextView will be wrong sometimes.(eg: font with larger space between characters will be cut off).

    Have a check to see if resize is necessary will fix the issue

    opened by Textcat 1
  • Definitely not working

    Definitely not working

    Hello, i spent some time trying setting up all properly(manual installation, pods installation, masonry framework installation) but just errors and crashes. Although very poor documentation, i decided to convert all to swift 3.0, and made all running after many tries(masonry framework has been just a pain, it should be autoincluded when installing with pods), but when i call any of the render function, the app crashes saying the UIGraphicsGetCurrentContext() returns nil.

    I Would be very happy to mention your library/name as it gets an update in order to work correctly =)

    opened by siideffect 0
  • issue on iOS 9

    issue on iOS 9

    i have a issue when build on real device (iOS 9 - iPhone 6) , it still work on simulator :

    Library not loaded: @rpath/Masonry.framework/Masonry Referenced from: /var/mobile/Containers/Bundle/Application/D31D044C-C5FF-4F25-A687-EF7278775175/Example.app/Example Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/D31D044C-C5FF-4F25-A687-EF7278775175/Example.app/Frameworks/Masonry.framework/Masonry: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/D31D044C-C5FF-4F25-A687-EF7278775175/Example.app/Frameworks/Masonry.framework/Masonry'

    opened by phamhoang2812 2
Owner
Remi ROBERT
Remi ROBERT
A view controller for iOS that allows users to crop portions of UIImage objects

TOCropViewController TOCropViewController is an open-source UIViewController subclass to crop out sections of UIImage objects, as well as perform basi

Tim Oliver 4.4k Jan 1, 2023
SwiftGif - A small UIImage extension with gif support.

SwiftGif - A small UIImage extension with gif support.

SwiftGif 1.3k Dec 20, 2022
IOS UIImage processing functions using the vDSP/Accellerate framework for speed.

UIImage Image Processing extensions using the vDSP/Accelerate framework.

null 372 Sep 1, 2022
Convert UIImage to ASCII art

BKAsciiImage As seen on Cmd.fm iOS App https://itunes.apple.com/app/cmd.fm-radio-for-geeks-hackers/id935765356 Installation BKAsciiImage is available

Barış Koç 427 Dec 17, 2022
An NSFW image detector for Swift built as an extension on UIImage.

Swift_NSFW_Detector An NSFW image detector for Swift built as an extension on UIImage. If you've ever allowed users to share images you are probably w

Chris Brown 5 Nov 27, 2022
A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

David Phillip Oster 2 Oct 28, 2022
An extension to SnapshotTesting which allows you to create HEIC images

?? SnapshotTestingHEIC An extension to SnapshotTesting which allows you to create HEIC images. The benefit of using HEIC instead of PNG is that it can

Aleksei Kakoulin 5 Dec 4, 2022
Zoomable - A container that allows you to zoom in and out of an image using only SwiftUI

Zoomable It is a container that allows you to zoom in and out of an image using

jasu 48 Nov 28, 2022
A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility.

THIS PROJECT IS NO LONGER MAINTAINED. STILL ONE ONLY BEST UI SOLUTION FOR UIKIT DEVELOPERS. SOON WILL COME UP WITH SWIFTUI STILL CONTRIBUTORS ARE WELC

Kiran Jasvanee 673 Dec 19, 2022