Latest 0.4.0
Homepage https://github.com/bnickel/SEMarkdownEditor
License MIT
Platforms ios 6.0, requires ARC
Dependencies SEStringUtilities
Frameworks Foundation
Authors

SEMarkdownEditor is a port of Pagedown’s Markdown.Editor.js transformation logic to Objective-C. While this does not provide rendering capabilities, it does allow you to create a full-fledged markdown toolbar for your UITextView similar to what you would see on StackExchange sites.

Example

Performing any transformation is a matter of getting the text and selection information from your UITextView, performing a transformation and updating the text view with the new text and selected region:

- (IBAction)toggleBoldface:(id)sender
{
    SEMarkdownTextChunks *chunks = [self.textView SE_textChunksFromSelection];
    [chunks toggleBoldface];
    [self.textView SE_updateWithTextChunks:chunks actionName:NSLocalizedString(@"markdown.boldface", @"Boldface")];
}
@IBAction func toggleBoldface(sender:AnyObject) {
    let chunks = textView.SE_textChunksFromSelection()
    chunks.toggleBoldface()
    textView.SE_updateWithTextChunks(chunks, actionName:NSLocalizedString("markdown.boldface", comment: "Boldface"))
}

Demo

The project contains an iOS demo with a simple toolbar demonstrating how to wire features to a toolbar. Open the project in Xcode 6 or later and run the iOS Demo target.

Installation

pod 'SEMarkdownEditor'

Latest podspec

{
    "name": "SEMarkdownEditor",
    "version": "0.4.0",
    "summary": "Text transformation functions for implementing a markdown toolbar in an iOS app.",
    "homepage": "https://github.com/bnickel/SEMarkdownEditor",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Brian Nickel": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/bnickel/SEMarkdownEditor.git",
        "tag": "v0.4.0"
    },
    "source_files": "SEMarkdownEditor/Core",
    "ios": {
        "source_files": "SEMarkdownEditor/UIKit",
        "public_header_files": "SEMarkdownEditor/UIKit/**/*.h",
        "frameworks": "UIKit"
    },
    "public_header_files": "SEMarkdownEditor/Core/**/*.h",
    "frameworks": "Foundation",
    "requires_arc": true,
    "dependencies": {
        "SEStringUtilities": [
            "~> 0.2.0"
        ]
    }
}

Pin It on Pinterest

Share This