Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dwarvesf/CodeViewer

A custom code editor SwiftUI view
https://github.com/dwarvesf/CodeViewer

codeviewer ios macos swift swiftui

Last synced: 8 days ago
JSON representation

A custom code editor SwiftUI view

Awesome Lists containing this project

README

        

# CodeViewer





platform

CodeViewer is a custom code editor SwiftUI view, which wrap around the [ace](http://ace.c9.io) editor.


image
image

## Features

- [x] Darkmode, lightmode adopt automatically
- [x] Syntax highlighting for over 110 languages (TextMate/Sublime Text.tmlanguage files can be imported)
- [x] Over 20 themes (TextMate/Sublime Text .tmtheme files can be imported)
- [x] Support SwiftUI

## Usage

```Swift
import SwiftUI
import CodeViewer

struct ContentView: View {
@State private var json = ""

var body: some View {
CodeViewer(
content: $json,
mode: .json,
darkTheme: .solarized_dark,
lightTheme: .solarized_light,
isReadOnly: true,
fontSize: 54
)
.onAppear {
json = """
{
"hello": "world"
}
"""
}
}
}

```

## Requirement
- iOS >= v13
- macOS >= v10.15