# CodeMirror-Swift
**Repository Path**: storm-tech/CodeMirror-Swift
## Basic Information
- **Project Name**: CodeMirror-Swift
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-04-20
- **Last Updated**: 2022-05-16
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS.
## Features
- 🍭 Lightweight CodeMirror wrapper (build 5.52.2)
- ✅ 100% Native Swift 5 and modern WKWebView
- 👑 Support iOS & macOS
- 🎧 Built-in addons
- 🔎 Customizable (Addon, Themes, Modes...)
- 📕 Dozen built-in themes and syntax highlight modes
- ⚡️ Ready to go
## Apps that uses CodeMirror-Swift
#### 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`
```swift
let url = Bundle.main.url(forResource: "data", withExtension: "json")!
let content = try! String(contentsOf: url)
codeMirrorView.setMimeType("application/json")
codeMirrorView.setContent(content)
```
## Example
- Run `./examples/CodeMirror-Swift-Example.xcodeproj`
## How to use addons?
1. Read [CodeMirror Documentation](https://codemirror.net)
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
- CodeMirror: https://codemirror.net
- CodeMirror-minified: https://www.npmjs.com/package/codemirror-minified
- Pierre-Olivier Latour: https://github.com/swisspol/CodeMirrorView
## License
CodeMirror-Swift is copyright 2020 Proxyman and available under MIT license. See the LICENSE file in the project for more information.