Animals Tutorial Lesson 9

Adding Rounded Corners to the Buttons

Watch the video: https://youtu.be/un17rjMhl4w
  1. Add this code to the viewDidLoad method in the ButtonController class:
        for v in view.subviews {
            if (v.isKindOfClass(UIButton)) {
                v.layer.cornerRadius = 4
            }
        }
  1. Add the same code to the viewDidLoad method in the AnimalViewController class to get rounded corners on the Back button. You can copy and paste the code from one file to the other.

No comments:

Post a Comment