How to add a frame button to a storyboard in Xcode 6

I want to create a button with a border in Xcode 6. For example, I want it to look like 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 code? Thanks.

+5
source share
2 answers

You can add a runtime attribute to the storyboard.

choose your button

Runtime attribute in storyboard

+19
source

"addImageButton" here is my UIButton, and I use the line of code below to create a border for 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 problem.

+4
source

All Articles