0

In my app, I would like to create a custom UIElement, in my case a UITextView with rounded corners and border color and everything. however I can only do it if I create the UITextView from code and add it to a view with the addSubView method.

That's not too elegant, plus it fails during the unit tests as well.

Is there a way how I can create my UITextView with using Interface Bulder and still being able to modify its layer property?

Any help is very much appreciated.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Zoltan Varadi
  • 2,468
  • 2
  • 34
  • 51

1 Answers1

1

If you create an IBOutlet by ctrl-dragging from the nib or storyboard to your .h file, you can access your graphical element as usual with something like myTextView.layer.cornerRadius = 5.0;.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
rdurand
  • 7,342
  • 3
  • 39
  • 72