在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mchakravarty/CodeEditorView开源软件地址(OpenSource Url):https://github.com/mchakravarty/CodeEditorView开源编程语言(OpenSource Language):Swift 100.0%开源软件介绍(OpenSource Introduction):SwiftUI code editor view for iOS and macOSThe Screenshots of the demo appThis is the default dark theme on macOS. Like in Xcode, messages have got an inline view on the right-hand side of the screen, which pops up into a larger overlay to display more information. The minimap on the right provides an outline of the edited text. The following is the default light theme on iOS. Both line highlighting and the minimap are currently not supported on iOS due to limitations in the iOS version of TextKit. Instead of the line highlight, both the current line (or the current selection range) and lines with messages are indicated with differently coloured line numbers in the gutter. How to use itTypical usage of the view is as follows. struct ContentView: View {
@State private var text: String = "My awesome code..."
@State private var position: CodeEditor.Position = CodeEditor.Position()
@State private var messages: Set<Located<Message>> = Set()
@Environment(\.colorScheme) private var colorScheme: ColorScheme
var body: some View {
CodeEditor(text: $text, position: $position, messages: $messages, language: .swift)
.environment(\.codeEditorTheme,
colorScheme == .dark ? Theme.defaultDark : Theme.defaultLight)
}
} Demo appTo see the DocumentationFor more information, see the package documentation. StatusI consider this to be pre-release quality. It is sufficient to start building something on it, but it is not yet ready for production. While the LicenseCopyright [2021..2022] Manuel M. T. Chakravarty. Distributed under the Apache-2.0 license — see the license file for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论