Git Product home page Git Product logo

cyrtextview's Introduction

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

cyrtextview's People

Contributors

illyabusigin avatar dpfannenstiel avatar srijs avatar mwhuss avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.