From the course: Learning iOS Animations with UIKit

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with dynamic views

Working with dynamic views - iOS Tutorial

From the course: Learning iOS Animations with UIKit

Start my 1-month free trial

Working with dynamic views

- [Instructor] For the last newsletter screen animation, we're going to programmatically create a label and set its constraints and then animate it. To make this a bit easier, we can break the process up into three stages. Stage one is to programmatically create the view and add it as a parent. Now, luckily for us, stage one is almost ready to go. As the starter project has our newsletterInfoLabel, programmatically created in viewDidLoad. Stage two is to set the labels' constraints in code, because we haven't actually set a frame, so it needs to know how big it is and where it's positioned. And stage three is to finally animate those constraints the way we'd like. Let's go down underneath animateWelcomeLabel and start ourselves our last animation function. We're going to call this addDynamicInfoLabel, and inside here, we're just going to call newsletterView.addSubview, and we're just going to add in the newsletterInfoLabel. So, there's stage one complete. Now, stage two is a big more…

Contents