Home

Awesome

<img alt="GitHub" width="80%" src="https://raw.githubusercontent.com/ProxymanApp/CodeMirror-Swift/master/screenshots/logo.png"> <img alt="screenshot" src="https://github.com/ProxymanApp/CodeMirror-Swift/blob/master/screenshots/screenshot.png"> <img alt="GitHub" src="https://img.shields.io/github/license/ProxymanApp/CodeMirror-Swift">

CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS.

Features

Apps that uses CodeMirror-Swift

<img src="https://raw.githubusercontent.com/ProxymanApp/Proxyman/master/screenshots/proxyman_logo.png" alt="Proxyman screenshot" width="50%" height="auto"/>

Modern and Delightful HTTP Debugging Proxy for macOS, iOS and Android ⚡️ • 🌎 https://proxyman.io

Installation

SPM

The easiest way to use this package is to add https://github.com/ProxymanApp/CodeMirror-Swift to your SPM dependency.

Manually

  1. Manually copy CodeMirrorWebView.swift and CodeMirrorView.bundle to your project.
  2. Customize to fit your need on index.html
  3. Set mode and Content
let url = Bundle.main.url(forResource: "data", withExtension: "json")!
let content = try! String(contentsOf: url)
codeMirrorView.setMimeType("application/json")
codeMirrorView.setContent(content)

Example

How to use addons?

  1. Read CodeMirror Documentation
  2. Enable your plugins in index.html

How to add new themes?

  1. Download CodeMirrror themes and put it on the folder Sources/CodeMirrorView.bundle/Contents/Resources/theme
  2. Load your theme in index.html
  3. Change by using codeMirrorView.setThemeName("material.css")

Credit

License

CodeMirror-Swift is copyright 2020 Proxyman and available under MIT license. See the LICENSE file in the project for more information.