GithubHelp home page GithubHelp logo

udbartrackballitem's Introduction

UDBarTrackballItem

Overview

UDBarTrackballItem is a button view for iOS which can position the text cursor (caret) and define the text selection of a text view in parallel to its touch drag movement. The user interaction pattern is similar to a Thinkpad TrackPoint.

The intention was to create a text navigation component for text editor apps that makes the task of frequent text positioning and selection more convenient. The default way of positioning and selection requires a touch down delay to distinguish view scrolling and editing mode as well as the magnifying glass which distract the precise positioning more that it helps. The tradeoff is a decrease in view real-estate for the input accessory view bar (which is quite common in text editors nowadays).

It is implemented as a UIBarButtonItem subclass to control the caret movement and text selection of a UITextView and intended to be use inside a InputAccessoryView (UIToolbar).

Screencast of the sample project example

Imgur

Screenshot of the sample project example

Features

  • Single tap dragging cursor (caret) positioning
  • Double tap dragging text selection
  • Auto scrolling of text view when positioning out of bound
  • Auto popup editing menu after positioning or selection
  • Horizontal side-to-side reach distance without re-tap
  • Horizontal and vertial layout orientations
  • Uses ARC and targets iOS 5.0+

Installation

To use UDBarTrackballItem in your own project:

  • Import UDBarTrackballItem.h and UDBarTrackballItem.m and all png image files into your project
  • Include UDBarTrackballItem.h (#import "UDBarTrackballItem.h") where needed, or in your precompiled header
  • Initialize the new UDBarTrackballItem for a UITextView

This project uses ARC and targets iOS 5.0+.

Usage

UDBarTrackballItem *trackballItem = [[UDBarTrackballItem alloc] initForTextView:_textView];
[_toolbar setItems:@[trackballItem] animated:YES];

Credits

Write app for the innovative inspiration for and first-time appearance of this component.

License

This code is distributed under the terms and conditions of the MIT license. Review the full LICENSE for all the details.

Support/Contact

Think you found a bug or just have a feature request? Just post it as an issue, but make sure to review the existing issues first to avoid duplicates. You can also hit me up at @uwe_ for anything else, or to let me know how you're using this component. Thanks!

udbartrackballitem's People

Contributors

djui avatar vinhnx avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.