Notepad alternatives and similar libraries
Based on the "Text" category.
Alternatively, view Notepad alternatives based on common mentions on social networks and blogs.
-
PhoneNumberKit
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. -
ZSSRichTextEditor
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view -
Twitter Text Obj
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform. -
FontAwesomeKit
Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons. -
TwitterTextEditor
A standalone, flexible API that provides a full-featured rich text editor for iOS applications. -
RichEditorView
DISCONTINUED. RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. -
SwiftyMarkdown
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options. -
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement. -
SwiftIconFont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon) -
NSStringEmojize
A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters -
Mustard
🌭 Mustard is a Swift library for tokenizing strings when splitting by whitespace doesn't cut it. -
Heimdall
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations. -
AttributedTextView
Easiest way to create an attributed UITextView (with support for multiple links and from html)
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Notepad or a related project?
README
Usage
let notepad = Notepad(frame: view.bounds, themeFile: "one-dark")
view.addSubview(notepad)
Notepad is just like any other UITextView, but you need to use the convenience initializer in order to use the themes. To create a new theme, copy one of the existing themes and edit the JSON.
Check out the [Xcode project](Example.xcodeproj) for an [example](Example). For full documentation read [the code](Notepad/Notepad.swift).
Extending an Existing Text View with Notepad Features
If you cannot work with the Notepad
subclass directly for some reason, you can set up an existing UITextView
or NSTextView
on your own.
For iOS, you have to initialize all TextKit components yourself. Take the following as a blueprint where you can swap in custom objects:
class ViewController: UIViewController {
var textView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
let containerSize = CGSize(width: self.view.bounds.width, height: CGFloat.greatestFiniteMagnitude)
let container = NSTextContainer(size: containerSize)
container.widthTracksTextView = true
let layoutManager = NSLayoutManager()
layoutManager.addTextContainer(container)
let storage = Storage()
let theme = Theme("one-dark")
storage.theme = theme
storage.addLayoutManager(layoutManager)
let editor = UITextView(frame: self.view.bounds, textContainer: container)
editor.backgroundColor = theme.backgroundColor
editor.tintColor = theme.tintColor
editor.autoresizingMask = [.flexibleWidth, .flexibleHeight]
}
}
And for macOS:
class ViewController: NSViewController {
@IBOutlet var textView: NSTextView!
let storage = Storage()
override func viewDidLoad() {
super.viewDidLoad()
let theme = Theme("one-dark")
storage.theme = theme
textView.backgroundColor = theme.backgroundColor
textView.insertionPointColor = theme.tintColor
textView.layoutManager?.replaceTextStorage(storage)
}
}
Themes
Take a look at all of the [themes and swatches](themes.md) when choosing the theme for your Notepad, or as inspiration for a new one.
You can find all of the raw themes in the [themes folder](Notepad/themes), and the file names are case-sensitive.
Custom Regex
Using regex, you can match custom patterns in your Notepad editor by passing a regex
attribute in your theme. For example, one that highlights Twitter handles in a teal color:
"handle": {
"regex": "[@@][a-zA-Z0-9_]{1,20}",
"color": "#78ddd5"
}
Installation
Copy the source from the Notepad folder to your project, or add Notepad to your Podfile if you're using CocoaPods.