CodeViewer is a custom code editor SwiftUI view, which wrap around the ace editor.
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"
}
"""
}
}
}