{"id":73081,"date":"2019-11-21T04:17:31","date_gmt":"2019-11-21T11:17:31","guid":{"rendered":""},"modified":"2019-11-21T04:17:31","modified_gmt":"2019-11-21T11:17:31","slug":"performing-ios-animations-on-views-with-uikit-and-uiview","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/","title":{"rendered":"Performing iOS Animations On Views With UIKit And UIView"},"content":{"rendered":"<link rel=\"canonical\" href=\"https:\/\/www.smashingmagazine.com\/2019\/11\/performing-ios-animations-views-uikit-uiview\/\"><title>Performing iOS Animations On Views With UIKit And UIView<\/title><\/p>\n<article>\n<header>\n<h1>Performing iOS Animations On Views With UIKit And UIView<\/h1>\n<address>Saravanan V<\/address>\n<p>                  <time datetime=\"2019-11-20T11:00:00+00:00\">2019-11-20T11:00:00+00:00<\/time><time datetime=\"2019-11-20T11:00:00+00:00\">2019-11-21T11:07:48+00:00<\/time><\/header>\n<p>I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations with the intent of exhaustively covering the different ways of doing the same.<\/p>\n<p>Given the extensiveness of the topic, we would cover each part succinctly at a fairly high level. The goal is to educate the reader with a set of choices to add animations to his\/ her iOS app.<\/p>\n<p>Before we start off with topics related to iOS, let us take a brief look at animation speed.<\/p>\n<h3>Animating At 60FPS<\/h3>\n<p>Generally in videos, each frame is represented by an image and the frame rate determines the number of images flipped in the sequence. This is termed as \u2018frames per second\u2019 or FPS.<\/p>\n<p>FPS determines the number of still images flipped within a second, which literally means that the more the number of images\/ frames, more details\/ information are displayed in the video. This holds true for animations as well.<\/p>\n<p>FPS is typically used to determine the quality of animations. There is a popular opinion that any good animation should run at 60fps or higher \u2014 anything less than 60fps would feel a bit off.<\/p>\n<p>Do you want to see the difference between 30FPS and 60FPS? <a href=\"http:\/\/www.30vs60fps.com\/\">Check this<\/a>!<\/p>\n<p>Did you notice the difference? Human eyes can definitely feel the jitter at lower fps. Hence, it is always a good practice to make sure that any animation you create, adheres to the ground rule of running at 60FPS or higher. This makes it feel more realistic and alive.<\/p>\n<p>Having looked at FPS, let\u2019s now delve into the different core iOS frameworks that provide us a way to perform animations.<\/p>\n<div data-component=\"FeaturePanel\" data-audience=\"non-subscriber\" data-remove=\"true\"><\/div>\n<h3>Core Frameworks<\/h3>\n<p>In this section, we will touch upon the frameworks in the iOS SDK which can be used for creating view animations. We will do a quick walk through each of them, explaining their feature set with a relevant example.<\/p>\n<h4>UIKit\/ UIView Animations<\/h4>\n<p>UIView is the base class for any view that displays content in iOS apps.<\/p>\n<p>UIKit, the framework that gives us UIView, already provides us some basic animation functions which make it convenient for developers to achieve more by doing less.<\/p>\n<p>The API, <code>UIView.animate<\/code>, is the easiest way to animate views since any view\u2019s properties can be easily animated by providing the property values in the block-based syntax.<\/p>\n<p>In UIKit animations, it is recommended to modify only the animatable properties of UIVIew else there will be repercussions where the animations might cause the view to end up in an unexpected state.<\/p>\n<h5>animation(withDuration: animations: completion)<\/h5>\n<p>This method takes in the animation duration, a set of view\u2019s animatable property changes that need to be animated. The completion block gives a callback when the view is done with performing the animation.<\/p>\n<p>Almost any kind of animation like moving, scaling, rotating, fading, etc. on a view can be achieved with this single API.<\/p>\n<p>Now, consider that you want to animate a button size change or you want a particular view to zoom into the screen. This is how we can do it using the <code>UIView.animate<\/code> API:<\/p>\n<div>\n<pre><code>let newButtonWidth: CGFloat = 60\n\nUIView.animate(withDuration: 2.0) { \/\/1\n    self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) \/\/2\n    self.button.center = self.view.center \/\/3\n}<\/code><\/pre>\n<\/div>\n<p>Here\u2019s what we are doing here:<\/p>\n<ol>\n<li>We call the <code>UIView.animate<\/code> method with a duration value passed to it that represents how long the animation, described inside the block, should run.<\/li>\n<li>We set the new frame of the button that should represent the final state of the animation.<\/li>\n<li>We set the button <code>center<\/code> with its superview\u2019s center so that it remains at the center of the screen.<\/li>\n<\/ol>\n<p>The above block of animation code should trigger the animation of the button\u2019s frame changing from current frame:<\/p>\n<\/p>\n<blockquote><p><code>Width = 0, Height = 0<\/code><\/p><\/blockquote>\n<p>To the final frame:<\/p>\n<\/p>\n<blockquote><p><code>Width = Height = newButtonWidth<\/code><\/p><\/blockquote>\n<p>And here\u2019s what the animation would look like:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/1-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/1-performing-ios-animations-on-views-with-uikit-uiview.gif?w=220&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<h5>animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion<\/h5>\n<p>This method is like an extension of the animate method where you can do everything that you can perform in the prior API with some physics behaviors added to the view animations.<\/p>\n<p>For example, if you want to achieve spring damping effects in the animation that we have done above, then this is how the code would look like:<\/p>\n<div>\n<pre><code>let newButtonWidth: CGFloat = 60\nUIView.animate(withDuration: 1.0, \/\/1\n    delay: 0.0, \/\/2\n    usingSpringWithDamping: 0.3, \/\/3\n    initialSpringVelocity: 1, \/\/4\n    options: UIView.AnimationOptions.curveEaseInOut, \/\/5\n    animations: ({ \/\/6\n        self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)\n        self.button.center = self.view.center\n}), completion: nil)<\/code><\/pre>\n<\/div>\n<p>Here\u2019s the set of parameters we use:<\/p>\n<ol>\n<li><code>duration<\/code><br \/>Represents the duration of the animation determining how long the block of code should run.<\/li>\n<li><code>delay<\/code><br \/>Represents the initial delay that we want to have before the start of the animation.<\/li>\n<li><code>SpringWithDamping<\/code><br \/>Represents the value of the springy effect that we want the view to behave. The value must be between 0 to 1. The lower the value, the higher the spring oscillation.<\/li>\n<li><code>velocity<\/code><br \/>Represents the speed at which the animation should start.<\/li>\n<li><code>options<\/code><br \/>Type of animation curve that you want to apply to your view animation.<\/li>\n<li>Finally, the block of code where we set the frame of the button that needs to be animated. It is the same as the previous animation.<\/li>\n<\/ol>\n<p>And here\u2019s what the animation would look like with the above animation configuration:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/2-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/2-performing-ios-animations-on-views-with-uikit-uiview.gif?w=352&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<h5>UIViewPropertyAnimator<\/h5>\n<p>For a bit more control over animations, <code>UIViewPropertyAnimator<\/code> comes handy where it provides us a way to pause and resume animations. You can have custom timing and have your animation to be interactive and interruptible. This is very much helpful when performing animations that are also interactable with user actions.<\/p>\n<p>The classic \u2018Slide to Unlock\u2019 gesture and the player view dismiss\/ expand animation (in the Music app) are examples of interactive and interruptible animations. You can start moving a view with your finger, then release it and the view will go back to its original position. Alternatively, you can catch the view during the animation and continue dragging it with your finger.<\/p>\n<p>Following is a simple example of how we could achieve the animation using <code>UIViewPropertyAnimator<\/code>:<\/p>\n<div>\n<pre><code>let newButtonWidth: CGFloat = 60\nlet animator = UIViewPropertyAnimator(duration:0.3, curve: .linear) { \/\/1\n    self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)\n    self.button.center = self.view.center\n}\nanimator.startAnimation() \/\/2<\/code><\/pre>\n<\/div>\n<p>Here\u2019s what we are doing:<\/p>\n<ol>\n<li>We call the <code>UIViewProperty<\/code> API by passing the duration and the animation curve.<\/li>\n<li>Unlike both the above UIView.animate API\u2019s, the animation won\u2019t start unless you specify it by yourself i.e. you\u2019re in full control of the complete animation process\/ flow.<\/li>\n<\/ol>\n<p>Now, let\u2019s say that you want even more control over the animations. For example, you want to design and control each and every frame in the animation. There\u2019s another API for that, <code>animateKeyframes<\/code>. But before we delve into it, let\u2019s quickly look at what a frame is, in an animation.<\/p>\n<div><\/div>\n<h4>What Is A <code>frame<\/code>?<\/h4>\n<p>A collection of the view\u2019s frame changes\/ transitions, from the start state to the final state, is defined as <code>animation<\/code> and each position of the view during the animation is called as a <code>frame<\/code>.<\/p>\n<h5>animateKeyframes<\/h5>\n<p>This API provides a way to design the animation in such a way that you can define multiple animations with different timings and transitions. Post this, the API simply integrates all the animations into one seamless experience.<\/p>\n<p>Let\u2019s say that we want to move our button on the screen in a random fashion. Let\u2019s see how we can use the keyframe animation API to do so.<\/p>\n<div>\n<pre><code>UIView.animateKeyframes(withDuration: 5, \/\/1\n  delay: 0, \/\/2\n  options: .calculationModeLinear, \/\/3\n  animations: { \/\/4\n    UIView.addKeyframe( \/\/5\n      withRelativeStartTime: 0.25, \/\/6\n      relativeDuration: 0.25) { \/\/7\n        self.button.center = CGPoint(x: self.view.bounds.midX, y: self.view.bounds.maxY) \/\/8\n    }\n\n    UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25) {\n        self.button.center = CGPoint(x: self.view.bounds.width, y: start.y)\n    }\n\n    UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.25) {\n        self.button.center = start\n    }\n})<\/code><\/pre>\n<\/div>\n<p>Here\u2019s the breakdown:<\/p>\n<ol>\n<li><code>duration<\/code><br \/>Call the API by passing in the duration of the animation.<\/li>\n<li><code>delay<\/code><br \/>Initial delay duration of the animation.<\/li>\n<li><code>options<\/code><br \/>The type of animation curve that you want to apply to your view animation.<\/li>\n<li><code>animations<\/code><br \/>Block that takes all keyframe animations designed by the developer\/ user.<\/li>\n<li><code>addKeyFrame<\/code><br \/>Call the API to design each and every animation. In our case, we have defined each move of the button. We can have as many such animations as we need, added to the block.<\/li>\n<li><code>relativeStartTime<\/code><br \/>Defines the start time of the animation in the collection of the animation block.<\/li>\n<li><code>relativeDuration<\/code><br \/>Defines the overall duration of this specific animation.<\/li>\n<li><code>center<\/code><br \/>In our case, we simply change the center property of the button to move the button around the screen.<\/li>\n<\/ol>\n<p>And this is how the final animations looks like:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/3-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/3-performing-ios-animations-on-views-with-uikit-uiview.gif?w=600&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<h4>CoreAnimation<\/h4>\n<p>Any UIKit based animation is internally translated into core animations. Thus, the Core Animation framework acts as a backing layer or backbone for any UIKit animation. Hence, all UIKit animation APIs are nothing but encapsulated layers of the core animation APIs in an easily consumable or convenient fashion.<\/p>\n<p>UIKit animation APIs don\u2019t provide much control over animations that have been performed over a view since they are used mostly for animatable properties of the view. Hence in such cases, where you intend to have control over every frame of the animation, it is better to use the underlying core animation APIs directly. Alternatively, both the UIView animations and core animations can be used in conjunction as well.<\/p>\n<h5>UIView + Core Animation<\/h5>\n<p>Let\u2019s see how we can recreate the same button change animation along with specifying the timing curve using the UIView and Core Animation APIs.<\/p>\n<p>We can use <code>CATransaction<\/code>\u2019s timing functions, which lets you specify and control the animation curve.<\/p>\n<p>Let\u2019s look at an example of a button size change animation with its corner radius utilizing the <code>CATransaction<\/code>\u2019s timing function and a combination of UIView animations:<\/p>\n<div>\n<pre><code>let oldValue = button.frame.width\/2\nlet newButtonWidth: CGFloat = 60\n\n\/* Do Animations *\/\nCATransaction.begin() \/\/1\nCATransaction.setAnimationDuration(2.0) \/\/2\nCATransaction.setAnimationTimingFunction(CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)) \/\/3\n\n\/\/ View animations \/\/4\nUIView.animate(withDuration: 1.0) {\n    self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)\n    self.button.center = self.view.center\n}\n\n\/\/ Layer animations\nlet cornerAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.cornerRadius)) \/\/5\ncornerAnimation.fromValue = oldValue \/\/6\ncornerAnimation.toValue = newButtonWidth\/2 \/\/7\n\nbutton.layer.cornerRadius = newButtonWidth\/2 \/\/8\nbutton.layer.add(cornerAnimation, forKey: #keyPath(CALayer.cornerRadius)) \/\/9\n\nCATransaction.commit() \/\/10<\/code><\/pre>\n<\/div>\n<p>Here\u2019s the breakdown:<\/p>\n<ol>\n<li><code>begin<\/code><br \/>Represents the start of the animation code block.<\/li>\n<li><code>duration<\/code><br \/>Overall animation duration.<\/li>\n<li><code>curve<\/code><br \/>Represents the timing curve that needs to be applied to the animation.<\/li>\n<li><code>UIView.animate<\/code><br \/>Our first animation to change the frame of the button.<\/li>\n<li><code>CABasicAnimation<\/code><br \/>We create the <code>CABasicAnimation<\/code> object by referring the <code>cornerRadius<\/code> of the button as the keypath since that\u2019s what we want to animate. Similarly, if you want to have granular level control over the keyframe animations, then you can use the <code>CAKeyframeAnimation<\/code> class.<\/li>\n<li><code>fromValue<\/code><br \/>Represents the starting value of the animation, i.e. the initial <code>cornerRadius<\/code> value of the button from where the animation must start off.<\/li>\n<li><code>toValue<\/code><br \/>Represents the final value of the animation, i.e. the final <code>cornerRadius<\/code> value of the button where the animation must end.<\/li>\n<li><code>cornerRadius<\/code><br \/>We must set the <code>cornerRadius<\/code> property of the button with the final value of the animation else the button\u2019s cornerRadius value will get auto-reverted to its initial value after the animation completes.<\/li>\n<li><code>addAnimation<\/code><br \/>We attach the animation object that contains the configuration of the entire animation process to the layer by representing the Keypath for which the animation needs to be performed.<\/li>\n<li><code>commit<\/code><br \/>Represents the end of the animation code block and starts off the animation.<\/li>\n<\/ol>\n<p>This is how the final animation would look like:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/4-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/4-performing-ios-animations-on-views-with-uikit-uiview.gif?w=444&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<p><a href=\"https:\/\/academy.realm.io\/posts\/tryswift-tim-oliver-advanced-graphics-with-core-animation\/\">This blog<\/a> is a great read to help create more advanced animations as it neatly walks you through most of the Core Animation framework APIs with instructions guiding you through every step of the way.<\/p>\n<div><\/div>\n<h4>UIKitDynamics<\/h4>\n<p>UIKit Dynamics is the physics engine for UIKit which enables you to add any physics behaviors like collision, gravity, push, snap, etc, to the UIKit controls.<\/p>\n<h5>UIKitDynamicAnimator<\/h5>\n<p>This is the admin class of the UIKit Dynamics framework that regulates all animations triggered by any given UI control.<\/p>\n<h5>UIKitDynamicBehavior<\/h5>\n<p>It enables you to add any physics behavior to an animator which then enables it to perform on the view attached to it.<\/p>\n<p>Different kinds of behaviors for UIKitDynamics include:<\/p>\n<ul>\n<li><code>UIAttachmentBehavior<\/code><\/li>\n<li><code>UICollisionBehavior<\/code><\/li>\n<li><code>UIFieldBehavior<\/code><\/li>\n<li><code>UIGravityBehavior<\/code><\/li>\n<li><code>UIPushBehavior<\/code><\/li>\n<li><code>UISnapBehavior<\/code><\/li>\n<\/ul>\n<p>The architecture of UIKitDynamics looks something like <a href=\"https:\/\/www.techotopia.com\/index.php\/File:Uikit_dynamics_architecture.png\">this<\/a>. Note that Items 1 to 5 can be replaced with a single view.<\/p>\n<p>Let us apply some physics behavior to our button. We will see how to apply gravity to the button so that it gives us a feeling of dealing with a real object.<\/p>\n<pre><code>var dynamicAnimator   : UIDynamicAnimator!\nvar gravityBehavior   : UIGravityBehavior!\n\ndynamicAnimator = UIDynamicAnimator(referenceView: self.view) \/\/1\n\ngravityBehavior = UIGravityBehavior(items: [button]) \/\/2\ndynamicAnimator.addBehavior(gravityBehavior) \/\/3<\/code><\/pre>\n<p>Here\u2019s the breakdown:<\/p>\n<ol>\n<li><code>UIKitDynamicAnimator<\/code><br \/>We have created a <code>UIKitDynamicAnimator<\/code> object which acts as an orchestrator for performing animations. We have also passed the superview of our button as the reference view.<\/li>\n<li><code>UIGravityBehavior<\/code><br \/>We have created a <code>UIGravityBehavior<\/code> object and pass our button into the array elements on which this behavior is injected.<\/li>\n<li><code>addBehavior<\/code><br \/>We have added the gravity object to the animator.\n<p>This should create an animation as shown below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/5-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/5-performing-ios-animations-on-views-with-uikit-uiview.gif?w=600&#038;ssl=1\"   alt=\"\"><\/a><figcaption>Notice how the button falls off from the center (its original position) of the screen to the bottom and beyond.<\/figcaption><\/figure>\n<p>We should tell the animator to consider the bottom of the screen to be the ground. This is where <code>UICollisionBehavior<\/code> comes into picture.<\/p>\n<pre><code>var dynamicAnimator   : UIDynamicAnimator!\nvar gravityBehavior   : UIGravityBehavior!\nvar collisionBehavior : UICollisionBehavior!\n\ndynamicAnimator = UIDynamicAnimator(referenceView: self.view) \/\/1\n\ngravityBehavior = UIGravityBehavior(items: [button]) \/\/2\ndynamicAnimator.addBehavior(gravityBehavior) \/\/3\n\ncollisionBehavior = UICollisionBehavior(items: [button]) \/\/4\ncollisionBehavior.translatesReferenceBoundsIntoBoundary = true \/\/5\ndynamicAnimator.addBehavior(collisionBehavior) \/\/6<\/code><\/pre>\n<\/li>\n<li><code>UICollisionBehavior<\/code><br \/>We have created a <code>UICollisionBehavior<\/code> object and passed along the button so that the behavior is added to the element.<\/li>\n<li><code>translatesReferenceBoundsIntoBoundary<\/code><br \/>Enabling this property tells the animator to take the reference views boundary as the end, which is the bottom of the screen in our case.<\/li>\n<li><code>addBehavior<\/code><br \/>We have added collision behavior to the animator here.\n<p>Now, our button should hit the ground and stand still as shown below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/6-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/6-performing-ios-animations-on-views-with-uikit-uiview.gif?w=600&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<p>That\u2019s pretty neat, isn\u2019t it?<\/p>\n<p>Now, let us try adding a bouncing effect so that our object feels more real. To do that, we will use the <code>UIDynamicItemBehavior<\/code> class.<\/p>\n<pre><code>var dynamicAnimator   : UIDynamicAnimator!\nvar gravityBehavior   : UIGravityBehavior!\nvar collisionBehavior : UICollisionBehavior!\nvar bouncingBehavior  : UIDynamicItemBehavior!\n\ndynamicAnimator = UIDynamicAnimator(referenceView: self.view) \/\/1\n\ngravityBehavior = UIGravityBehavior(items: [button]) \/\/2\ndynamicAnimator.addBehavior(gravityBehavior) \/\/3\n\ncollisionBehavior = UICollisionBehavior(items: [button]) \/\/4\ncollisionBehavior.translatesReferenceBoundsIntoBoundary = true \/\/5\ndynamicAnimator.addBehavior(collisionBehavior) \/\/6\n\n\/\/Adding the bounce effect\nbouncingBehavior = UIDynamicItemBehavior(items: [button]) \/\/7\nbouncingBehavior.elasticity = 0.75 \/\/8\ndynamicAnimator.addBehavior(bouncingBehavior) \/\/9<\/code><\/pre>\n<\/li>\n<li><code>UIDynamicItemBehavior<\/code><br \/>We have created a <code>UIDynamicItemBehavior<\/code> object and pass along the button so that the behavior is added to the element.<\/li>\n<li><code>elasticity<\/code><br \/>Value must be between 0-1, it represents the elasticity i.e. the number of times the object must bounce on and off the ground when it is hit. This is where the magic happens \u2014 by tweaking this property, you can differentiate between different kinds of objects like balls, bottles, hard-objects and so on.<\/li>\n<li><code>addBehavior<\/code><br \/>We have added collision behavior to the animator here.<\/li>\n<\/ol>\n<p>Now, our button should bounce when it hits the ground as shown below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/7-performing-ios-animations-on-views-with-uikit-uiview.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/7-performing-ios-animations-on-views-with-uikit-uiview.gif?w=600&#038;ssl=1\"   alt=\"\"><\/a><\/figure>\n<p><a href=\"https:\/\/github.com\/yudiz-solutions\/UIKit-Dynamics\">This repo<\/a> is quite helpful and shows all UIKitDynamics behaviors in action. It also provides source code to play around with each behavior. That, in my opinion, should serve as an extensive list of ways to perform iOS animations on views!<\/p>\n<p>In the next section, we will take a brief look into the tools that will aid us in measuring the performance of animations. I would also recommend you to look at <a href=\"https:\/\/blog.flexiple.com\/xcode-build-optimization-a-definitive-guide\/\">ways to optimize your Xcode build<\/a> since it will save a huge amount of your development time.<\/p>\n<h3>Performance Tuning<\/h3>\n<p>In this section, we will look at ways to measure and tune the performance of iOS animations. As an iOS developer, you might have already used Xcode Instruments like Memory Leaks and Allocations for measuring the performance of the overall app. Similarly, there are instruments that can be used to measure the performance of animations.<\/p>\n<h4><code>Core Animation<\/code> Instrument<\/h4>\n<p>Try the <code>Core Animation<\/code> instrument and you should be able to see the FPS that your app screen delivers. This is a great way to measure the performance\/ speed of any animation rendered in your iOS app.<\/p>\n<h4>Drawing<\/h4>\n<p>FPS is vastly lowered in the app that displays heavy content like images with effects like shadows. In such cases, instead of assigning the Image directly to the <code>UIImageView<\/code>\u2019s image property, try to draw the image separately in a context using Core Graphics APIs. This overly reduces the image display time by performing the image decompression logic asynchronously when done in a separate thread instead of the main thread.<\/p>\n<h4>Rasterization<\/h4>\n<p>Rasterization is a process used to cache complex layer information so that these views aren\u2019t redrawn whenever they\u2019re rendered. Redrawing of views is the major cause of the reduction in FPS and hence, it is best to apply rasterization on views that are going to be reused several times.<\/p>\n<h3>Wrapping Up<\/h3>\n<p>To conclude, I have also summed up a <a href=\"https:\/\/blog.flexiple.com\/the-ultimate-list-of-resources-for-ios-animations\/\">list of useful resources for iOS animations<\/a>. You may find this very handy when working on iOS animations. Additionally, you may also find <a href=\"https:\/\/www.remote.tools\/category\/Design-Collaboration\">this set of design tools<\/a> helpful as a (design) step before delving into animations.<\/p>\n<p>I hope I have been able to cover as many topics as possible surrounding iOS animations. If there is anything I may have missed out in this article, please let me know in the comments section below and I would be glad to make the addition!<\/p>\n<div>\n  <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/logo-red-17.png?w=900&#038;ssl=1\" alt=\"Smashing Editorial\"><span>(dm, yk, il)<\/span>\n<\/div>\n<\/article>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener noreferrer\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Performing iOS Animations On Views With UIKit And UIView Performing iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00 I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[],"tags":[],"class_list":["post-73081","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-11-21T11:17:31+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-11-21T11:17:31+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#article\",\"name\":\"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies\",\"headline\":\"Performing iOS Animations On Views With UIKit And UIView\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/1-performing-ios-animations-on-views-with-uikit-uiview.gif\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#articleImage\"},\"datePublished\":\"2019-11-21T04:17:31-07:00\",\"dateModified\":\"2019-11-21T04:17:31-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#webpage\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#listItem\",\"name\":\"Performing iOS Animations On Views With UIKit And UIView\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#listItem\",\"position\":2,\"name\":\"Performing iOS Animations On Views With UIKit And UIView\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/\",\"name\":\"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies\",\"description\":\"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/11\\\/performing-ios-animations-on-views-with-uikit-and-uiview\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"datePublished\":\"2019-11-21T04:17:31-07:00\",\"dateModified\":\"2019-11-21T04:17:31-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies","description":"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations","canonical_url":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#article","name":"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies","headline":"Performing iOS Animations On Views With UIKit And UIView","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/11\/1-performing-ios-animations-on-views-with-uikit-uiview.gif","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#articleImage"},"datePublished":"2019-11-21T04:17:31-07:00","dateModified":"2019-11-21T04:17:31-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#webpage"}},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#listItem","name":"Performing iOS Animations On Views With UIKit And UIView"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#listItem","position":2,"name":"Performing iOS Animations On Views With UIKit And UIView","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/","name":"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies","description":"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"datePublished":"2019-11-21T04:17:31-07:00","dateModified":"2019-11-21T04:17:31-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies","og:description":"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations","og:url":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/","article:published_time":"2019-11-21T11:17:31+00:00","article:modified_time":"2019-11-21T11:17:31+00:00","twitter:card":"summary","twitter:title":"Performing iOS Animations On Views With UIKit And UIView | Design for Immersive Technologies","twitter:description":"Performing iOS Animations On Views With UIKit And UIViewPerforming iOS Animations On Views With UIKit And UIView Saravanan V 2019-11-20T11:00:00+00:002019-11-21T11:07:48+00:00I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations"},"aioseo_meta_data":{"post_id":"73081","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-07 16:43:30","updated":"2026-09-02 12:51:52","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPerforming iOS Animations On Views With UIKit And UIView\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"Performing iOS Animations On Views With UIKit And UIView","link":"https:\/\/www.taterboy.com\/blog\/2019\/11\/performing-ios-animations-on-views-with-uikit-and-uiview\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-j0J","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/73081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=73081"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/73081\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=73081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=73081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=73081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}