Skip to content

iOS Notes style rich text formatting for UITextView using NSAttributedString

Notifications You must be signed in to change notification settings

Rimesh/NotesTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NotesTextView

iOS Notes style formatting for UITextView using NSAttributedString

iPhone iPad Screenshots

Features

  • Custom Keyboard
  • Accessory View
  • iPad Support
  • Dark Mode Support
  • Font Styles
    • Title
    • Heading
    • Body
    • Serif
  • Text Formatting
    • Bold
    • Italics
    • Underline
    • Strikethrough
  • Text Alignment
  • Text Indents
  • Text Colors
  • Text Highlights
  • Undo Management

How to use

  • Add NotesTextView framework to your project. See how to do this here
  • import NoteTextView in your ViewController and use the code below
    let textView = NotesTextView()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addSubview(textView)
        textView.translatesAutoresizingMaskIntoConstraints = false
        textView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
        textView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true
        textView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true
        textView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
        
        
        // to adjust the content insets based on keyboard height
        textView.shouldAdjustInsetBasedOnKeyboardHeight = true
        
        // to support iPad
        textView.hostingViewController = self
        
        let _ = textView.becomeFirstResponder()
        
    }

Apps Using NotesTextView

Contributions

I'm always looking to improve this project. If you would like to contribute fork the repo and open a pull request with your changes.

Author

Rimesh Jotaniya

Licence

Copyright (c) 2020 Rimesh Jotaniya rimesh.j@icloud.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

iOS Notes style rich text formatting for UITextView using NSAttributedString

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published