WIP document editor for iOS

Related tags

Editor pilcrow
Overview

¶ Pilcrow

This is an work-in-progress experiment on building a document editor similar to Bear, Notion, Notes.app, Craft, Dropbox Paper, and others. I open-sourced it in case anyone is curious to follow along after my initial tweets. I'm not looking for contributions at this point, since the code is not production ready and I may make substantial changes before 1.0. But would love to hear suggestions for improvement or feature requests, just open an issue.

I have ideas for a few apps I'd like to build around this kind of document, so my main goal is to build the core editor first, and then extract it to a reusable framework to build on top.

Screenshot of Pilcrow demo on iOS

Block type support

  • Paragraph/Text
  • Heading
  • Todo
  • Bulleted list item
  • Numbered listed item
  • Blockquote
  • Divider

Punting on these for now since they have ramifications for the document format

  • Image
  • Attachment

Features

An incomplete and unordered to-do list of features I'm planning on adding support for.

  • Toolbar
  • Persistence (rebuild on top of UIDocumentBrowserViewController/UIDocument)
  • Inline text formatting (bold, italic, underline, strikethrough, link)
  • Indent/dedent
  • Document consistency (e.g. - moving items should ensure correct numbered items)
  • Improved keyboard navigation
  • Swipe actions on rows
  • Drag-and-drop
  • Finish block types
  • Import from Markdown
  • Export to Markdown

Architecture

The core of the app is a Document composed of an array of Blocks. Each Block can have a different content type and renders as its own cell/row in a UICollectionView or UITableView. See tweet above for discussion of the merits of this approach vs using a UITextView based approach. This seemed the most flexible long-term, at the cost of losing some text editing niceties.

The app is based on UIDocumentBrowserViewController/UIDocument for handling persistence. The document format isn't finalized, so if you play with this you'll most likely lose your data over time. Though the current format is just JSON, so should be fairly simple to recover.

License

Author

You might also like...
A fully fledged syscfg editor. Just the editor. Written in pure swift.
A fully fledged syscfg editor. Just the editor. Written in pure swift.

MagicCFG Reloaded The SysCFG Writing Utility - UPDATED, OSV Report Bug Table of Contents About MagicCFG Reloaded Getting Started Roadmap Contact Credi

AnylineFaceAuthentication pairs identity document scanning with a real-time liveness check utilizing the iPhone's camera, best suited for authenticating users over the internet.

AnylineFaceAuthentication AnylineFaceAuthentication pairs identity document scanning with a real-time liveness check utilizing the iPhone's camera, be

A convenient class usable from UIKit view controller or SwiftUI to scan document & get UIImage or PDFDocument as result - Replacement of IRLDocumentScanner

Super easy SwiftUI & UKKit pakcage to scan: Images or PDF. It is also a replacement for IRLScannerViewController

A document-based app in Swift Playgrounds 4 for iPad
A document-based app in Swift Playgrounds 4 for iPad

A document-based SwiftUI app in Swift Playgrounds This sample project demonstrat

Swift framework for document classification using a Core ML model.
Swift framework for document classification using a Core ML model.

DocumentClassifier Overview DocumentClassifier is a Swift framework for classifying documents into one of five categories (Business, Entertainment, Po

The sample implementation of zip-archived document for a macOS AppKit platform.
The sample implementation of zip-archived document for a macOS AppKit platform.

The sample implementation of zip-archived document for a macOS AppKit platform. You can implement NSDocument-based I/O of archived document in your application like .sketch or .key.

A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.
A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.

Trace A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.

Fully open source text editor for iOS written in Swift.
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Notepad - A fully themeable iOS markdown editor with live syntax highlighting.
Notepad - A fully themeable iOS markdown editor with live syntax highlighting.

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.

A standalone, flexible API that provides a full-featured rich text editor for iOS applications.
A standalone, flexible API that provides a full-featured rich text editor for iOS applications.

Twitter Text Editor A standalone, flexible API that provides a full featured rich text editor for iOS applications. This provides a robust text attrib

CodeEditorView Swift package provides a SwiftUI view implementing a rich code editor for iOS and macOS Fully open source text editor for iOS written in Swift.
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Phimp.me - Photo Image Editor and Sharing App. Phimp.me is a Photo App for iOS that aims to replace proprietary photo applications. It offers features such as taking photos, adding filters, editing images and uploading them to social networks. A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.

It is Strings but with a Z 😬 Loved the project? Please share it with your friends and give it a ⭐️ Stringz is a lightweight and powerful editor that

A rich-text editor for iOS

DTRichTextEditor This project aims to provide a replacement for Apple's severely limited UITextView and to allow for editing attributed strings. It co

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view

ZSSRichTextEditor The Editor ZSSRichTextEditor is a beautiful Rich Text WYSIWYG Editor for iOS. It includes all of the standard editor tools one would

RichTexture is a rich text editor for iOS.

RichTexture About RichTexture is a rich text editor for iOS. Running Open RichTexture.xcworkspace, change the bundle identifier to an identifier linke

Image Editor iOS App - CLEAN Architecture + MVP Pattern
Image Editor iOS App - CLEAN Architecture + MVP Pattern

Image Editor iOS Application - Built using UIKit, CoreData, CoreImage, and URLSession Frameworks with CLEAN Architecture and MVP UI design pattern.

📷 A composable image editor using Core Image and Metal.
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component 🎉 v2.0.0-alpha now open!

Comments
  • Blocks v2

    Blocks v2

    A major refactoring of the block model, which is a big departure from the initial version. At first, I was treating type safety as critical so every block had a specific type and behavior. Ultimately though, this was too inflexible and complex. Ended up with lots of code to do simple things. The biggest issue though is would make it hard to extend for consumers of the framework. For example, before the main Block type was an enum, so it was impossible to extend. Now with a single Block type and Block.Kind is a struct, you can easily add new block types.

    Inspired by Notion's model, I implemented a similar data model. Now there is just one Block type, and everything else is set as properties on the block. This is dramatically simpler, but at the cost of losing type safety. For example, there is no TodoBlock, but a Block of kind: .todo with the complete state stored on the properties as ["completed": "true"]. There is nothing stopping you from setting the completed property on a paragraph block. This is a trade-off favoring flexibility over safety.

    To test this out further, I also started extracting a separate framework for Pilcrow and then consume that in both an iOS and macOS demo app. As I build more of this out and the other app I'm working on though, I'm not sure how viable it is for it to be used as a framework. The underlying model could be shared, but most of the complexity is in the UI, and though I could provide views in the library, it seems likely that's something an app will want full control over and would be better to do a custom UI.

    opened by zachwaugh 0
  • UIDocument/UIDocumentBrowser

    UIDocument/UIDocumentBrowser

    Get rid of the temporary document storage in favor of UIDocument and UIDocumentBrowserViewController. Currently not handling conflicts, though they're possible if you stored a document in iCloud and edited it in both places.

    opened by zachwaugh 0
  • Drag-and-drop

    Drag-and-drop

    Adds support for drag-and-drop to reorder blocks in a document. I couldn't get the diffable data source reorderingHandlers to work (https://developer.apple.com/documentation/uikit/uicollectionviewdiffabledatasource/3600965-reorderinghandlers?changes=_8), so did it the manual way.

    drag-drop

    opened by zachwaugh 0
  • Setup GitHub Actions

    Setup GitHub Actions

    Run tests on every commit. Currently blocked due to lack of macOS 11/ Xcode 12.5/Swift 5.4 support for GitHub Actions - https://github.com/actions/virtual-environments/issues/2486

    opened by zachwaugh 0
Owner
Zach Waugh
iOS Developer
Zach Waugh
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.

It is Strings but with a Z ?? Loved the project? Please share it with your friends and give it a ⭐️ Stringz is a lightweight and powerful editor that

Heysem Katibi 848 Jan 7, 2023
Finite Automata iPad Editor

Automata Editor This is a repository of Automata Editor which is an iPad app for editing finite automata. It uses CoreML to recognize your strokes and

Marek Fořt 56 Dec 13, 2022
📱 A simple wallpaper editor application for iPhone. Create your own wallpapers with a beautiful shelves.

iShelf A simple wallpaper editor application for iPhone. Create your own wallpapers with a beautiful shelves. ?? Demo ?? Screenshots ✨ Features Lots o

Daniel Tvorun 5 Nov 3, 2022
SwiftUI Implementation of RichEditorView (WYSIWYG Editor)

A Rich Text Editor (WYSIWYG Editor) for your application by combining UIKit and SwiftUI.

Formaloo 36 Jan 7, 2023
A Xcode Source Editor Extension to sort your header imports and remove duplicates, similar to iSort.

CleanHeaders An Xcode plug-in to format your import headers in a systematic manner. It simply removes duplicates, spaces and sorts them alphabetically

Karthikeya Udupa 93 Oct 9, 2021
null 1 Jan 24, 2022
Apps for translating Braille document captured by iPhone camera, then send translation result to ITS's Braille printer for duplicating purpose (re-printing, copying braille document with no original text)

SCANDO iOS On my Final Project (Thesis) for my Bachelor degree, I made an apps that translate Braille Document, and send the translation result to the

Ricki Bin Yamin 21 Aug 10, 2021
A WIP Swift wrapper for Discord's Bot API.

Quickcord Quickcord is a WIP Swift wrapper for Discord's Bot API. Features (As of right now) Connecting the the gateway and identifying. Literally eve

Ben Sova 4 Aug 7, 2021
Another Virtualization.framework demo project, with focus to iBoot (WIP)

Virtual iBoot Fun This is just another Virtualization.framework sample project (WIP), but with focus on iBoot (iOS/macOS/tvOS/etc. bootloader) For a m

john 119 Dec 7, 2022
React-native-photo-editor - Photo editor using native modules for iOS and Android

?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, ZLImageEditor (iOS) and PhotoEditor (Android)

Baron Ha. 244 Jan 5, 2023