Skip to content

UITextView subclass able to decorate the text with a customisable marker pen effect

Notifications You must be signed in to change notification settings

ndPPPhz/TapeTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TapeTextView

Introduction

TapeTextView is a UITextViewSubclass which gives you the opportunity to add a marker pen effect to your text.


Installation

Cocoapods

Install Cocoapods if need be.

$ gem install cocoapods

Add TapeTextView in your Podfile.

use_frameworks!

pod 'TapeTextView'

Then, run the following command.

$ pod install

Initialization

  • With Autolayout
let tapeView = TapeTextView()
tapeView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(tapeView)

tapeView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
tapeView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true

tapeView.attributedText = NSAttributedString(string: text, attributes: [.font: font])
tapeView.tapeColor = color
  • Without Autolayout
let tapeView = TapeTextView(frame: frame)
tapeView.attributedText = NSAttributedString(string: text, attributes: [.font: font])
tapeView.tapeColor = color
tapeView.autoresizeBasedOnTextLength = autoResize
view.addSubview(tapeView)

Features

You can control

  • the inclination of the marker effect via var degrees: CGFloat
  • the height factor of the marker effect via var heightFactor: CGFloat
  • the lineSpacing via var lineSpacing: CGFloat

License

License

MIT license

  • Copyright 2018 © Annino De Petra

About

UITextView subclass able to decorate the text with a customisable marker pen effect

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages