How to Create UIButtons programmatically with Auto Layout

Design and animate buttons using layout constraints in Swift

   Watch Promo

You may want to create a button programmatically with code using Swift. If you've only created buttons in Xcode with the interface designer, the process can be a little foreign.

In this mini-course you will learn how to add buttons to your app dynamically. You can add buttons or content in response to user input or interaction – this is very powerful because you can customize the UI.

Interface Builder in Xcode is great for static interfaces, but you will need to use outlets and actions to trigger events that can change your app. This makes the app fun and exciting for users.

Follow along and learn how to create dynamic buttons in code using Swift – download all the source code and you can use this in your next iPhone app.


Your Instructor


Paul Solt

Paul Solt has been teaching online courses for the past three years. Thousands of students have created their first, second, and third apps with Paul's expert instruction.

Paul has a Masters in Computer Science and has worked as an adjunct professor at RIT. He also writes for InfoWorld.com.

Paul understands programming fundamentals and how to teach the essentials in an accessible manner, instead of overwhelming you with too much, too fast.



Frequently Asked Questions


When does the course start and finish?
The course starts now and never ends! It is a completely self-paced online course - you decide when you start and when you finish.
How long do I have access to the course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 30 days and we will give you a full refund.

Get started now!