Code Editor UITextView
You can use it to edit code with highlight and auto indent
- import main header
#import "CodeEditorView.h"
- create a view to your view
CodeEditorView* codeView = [[CodeEditorView alloc] initWithLanguage:CodeEditorLanguageCpp];
[codeView setFrame:self.view.frame];
[self.view addSubview:codeView];
- done!
- if you want to load code by code, use
[codeView loadText:@"#include <cstdio>\nint main() {\n\tprintf(\"hello world\");\n\treturn 0;\n}"];
- Simply drag folder
CodeEditorView
to your project - Install with pod
pod install CodeEditorView
We support C
, Cpp
, Pascal
and Java
grammar highlight now
typedef enum {
CodeEditorLanguageC = 0,
CodeEditorLanguageCpp,
CodeEditorLanguagePascal,
CodeEditorLanguageJava,
CodeEditorLanguagePlain
} CodeEditorLanguageType;
We just have one theme now just like Xcode
. Hope for more in the future.
Module | Git | License |
---|---|---|
TextKit_LineNumbers | https://github.com/alldritt/TextKit_LineNumbers.git | MIT |
RFKeyboardToolbar | https://github.com/ruddfawcett/RFKeyboardToolbar.git | MIT |
MIT