Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem in -[CALayer setBorderColor:]

I want to have border around my textview; for that, I did the following:

textView.layer.borderWidth = 5.0f;
textView.layer.borderColor = [UIColor grayColor];   

I am getting the following warning:

warning: passing argument 1 of 'setBorderColor:' from incompatible pointer type

Update1 : my border is not visible

like image 384
user198725878 Avatar asked Dec 02 '22 04:12

user198725878


1 Answers

Your problem is that -[CALayer setBorderColor:] takes an object of type CGColorRef. What you need to do is convert your color object to conform:

textView.layer.borderColor = [UIColor grayColor].CGColor;

I hope that helped!

like image 188
Jonathan Sterling Avatar answered Dec 05 '22 23:12

Jonathan Sterling