TapeTextView
is a UITextViewSubclass which gives you the opportunity to add a marker pen effect to your text.
Install Cocoapods if need be.
$ gem install cocoapods
Add TapeTextView
in your Podfile
.
use_frameworks!
pod 'TapeTextView'
Then, run the following command.
$ pod install
- 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)
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
- Copyright 2018 © Annino De Petra