Skip to content
项目

关于

CYRTextView 是 UITextView 的子类,实现了多种适用于语法或代码文本视图的功能。

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

CYRTextView

Version License Platform

by Illya Busigin

Purpose

CYRTextView is a UITextView subclass that implements a variety of features that are relevant to a syntax or code text view. There are many subclasses of UITextView out there with the release of TextKit but none that are specifically tailored towards a code/syntax view. CYRTextView aims to change this. Features include:

  • Regular expression based text highlighting with support for multiple text attributes for each expression
  • Line numbers
  • Gesture based navigation

Long term, I would like to turn CYRTextView into a full fledged code editor component with code folding, markers, annotation, and more.

Screenshot

Requirements

iOS 7.0 or later (with ARC) for iPhone, iPad and iPod touch

Installation

To use CYRTextView, just drag the class files into your project and add the CoreText framework. You can create CYRTextView instances programatically, or create them in Interface Builder by dragging an ordinary UITextView into your view and setting its class to CYRTextView.

If you are using Interface Builder, to set the custom properties of CYRTextView (ones that are not supported by regular UIViews) either create an IBOutlet for your view and set the properties in code, or use the User Defined Runtime Attributes feature in Interface Builder (introduced in Xcode 4.2 for iOS 5+).

NOTE: The current version (0.4.0) is alpha quality at best. Use at your own risk!

Example

CYRTextView includes an example project that demonstrates how to subclass CYRTextView to provide highlighting behavior for multiple attributes with a default set of normal, bold, and italic fonts.

Bugs & Feature Requests

There is no support offered with this component. If you would like a feature or find a bug, please submit a feature request through the GitHub issue tracker.

Pull-requests for bug-fixes and features are welcome!

Attribution

CYRTextView uses portions of code from the following sources.

Component Description License
NLTextView A UITextView with Syntax Highlighting and Pan-Gesture Navigation / Selection MIT
TextKit_LineNumbers iOS7 Text Kit - Text View with Line Numbers MIT

探索相关项目

加载中…