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.
Creating an animation manager - iOS Tutorial
From the course: Learning iOS Animations with UIKit
Creating an animation manager
- [Instructor] For these next two sections, we're going to be using more coordinate math so I think this is a good time to start an AnimationManager to make our lives a bit easier. Let's go back into our Xcode project, select the Animation subfolder, right click and select new file. We want this to be a Swift File. We'll name this AnimationManager and hit Create. Now all we need for now is to get some screen positions so we don't have to manually calculate the ones we use most often. This is a good practice in general and will really help us with our key frame and auto layout animations. First thing we're going to do is replace the import Foundation with import UIKit and initialize the class. Inside our class, the first thing we need to get is the screen bounds of whatever device our app is running on. I'm going to add a comment in here Calculated screen bounds and we're going to make this variable and all our screen positions computed class properties so we don't need to initialize…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.