Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Self-Destructing Message iPhone App Designing and Starting the App Adding Login and Sign Up Screens

Round Rect-style buttons in Xcode 7

I cannot find any info on how to create a button in this style in the current version of Xcode. There is only one type of button object now, and I cannot figure out how to give it a border or otherwise make it look like the Round Rect Button object used here. Any help would be greatly appreciated!

1 Answer

In Xcode7, we need to write a few codes to create a round rect button.

Here's the example of the login button.

First, create button property in LoginViewController.h.

@property (weak, nonatomic) IBOutlet UIButton *loginButton;

<p>Then, open LoginViewController.m and add this code inside the ViewDidLoad method.</p>

self.loginButton.layer.cornerRadius = 10; 

<p>That's it! You can't see the change in the storyboard, but it will show on simulator.</p>

<p>Hope this helps you.</p>