Skip to content
Corrado Ubezio edited this page May 31, 2013 · 5 revisions

CRDTextView is a custom class that inherits from UILabel; it implements a read-only text view adding the following capabilities of a UITextField object:

  • placeholder and secureText text attributes;
  • ability to copy the text property value to the pasteboard.

Adding a CRDTextView object using Interface Builder

Since CRDTextView inherits from the UILabel class, these super class objects will represent the instances of our custom class in Interface Builder.

With a nib or storyboard file open, drag a generic UILabel from the Object Library into the view controller.

Object picking

Select the UILabel just added and go to the Identity Inspector and type CRDTextView in the Class and Label fields.

Identity Inspector

The Label field in the Identity inspector defines the display name of the CRDTextView object.

If it is required a placeholder, go to the Attributes Inspector and type whatever you want in the Text field.

Attributes Inspector

You can now use the CRDTextView custom object to create outlet and action connections to other objects in your nib or storyboard file.

More screenshots of the demo app can be found here.

Clone this wiki locally