James
James

Reputation: 1151

How to add a button with border to storyboard in Xcode 6

I wanna create a button with border in Xcode 6. For instance, I want it to look like the buttons from this library - https://github.com/a1anyip/AYVibrantButton - without any special visual effects. Is it possible to achieve this by doing some setup in IB without writing any code? Thanks.

Upvotes: 12

Views: 33289

Answers (2)

Leo
Leo

Reputation: 24714

You can add Runtime Attribute in storyboard

select your button

Runtime Attribute in storyboard

Upvotes: 30

user1722889
user1722889

Reputation:

"addImageButton" here is my UIButton and I am using below lines of code to create border to the button.

 [addImageButton.layer setBorderWidth:5];
[addImageButton.layer setBorderColor:[[UIColor redColor] CGColor]];
[addImageButton setTintColor:[UIColor whiteColor]];
[addImageButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

Snapshot

Hope this solves your issue.

Upvotes: 8

Related Questions