CALayer does not seem to be defined

I wanted to add a rounded Rect to a UITextView, as described in How to configure a UITextview as a Rounded Rect text field? . However, when I do this, I get an error that the methods used there were not found. I think this is strange since they are still in the documentation. Xcode, on the other hand, shows nothing in autocomplete on the field layer. Is this field somehow obsolete or where might the problem be?

Here are two pieces of code that I used:

@interface AddItemViewController : UIViewController { IBOutlet UITextView *detailsTextView; } @end 

He will be killed by Eigenschaft.

  - (void)viewDidLoad { [super viewDidLoad]; // add rounded rects to detailsTextView //first leads to warning that method is unknown [detailsTextView.layer setCornerRadius:8.0f]; // displays error that property is not found on object of type CALayer * textView.layer.cornerRadius = 8.0f; detailsTextView.clipsToBounds = YES; } 
+4
source share
1 answer

Add QuartzCore Frames to Your Project

Include this in your .h file

 #import <QuartzCore/QuartzCore.h> 
+18
source

All Articles