<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Antonio Mennillo on Medium]]></title>
        <description><![CDATA[Stories by Antonio Mennillo on Medium]]></description>
        <link>https://medium.com/@antonio.mennillo?source=rss-24ff46cbb158------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sRH8akVnmRqEFCw0ixXO2g.jpeg</url>
            <title>Stories by Antonio Mennillo on Medium</title>
            <link>https://medium.com/@antonio.mennillo?source=rss-24ff46cbb158------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:49:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antonio.mennillo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Add Amazing Frame-by-frame Animations in SwiftUI]]></title>
            <link>https://medium.com/better-programming/how-to-create-amazing-animations-in-swiftui-3c2970ee6e0?source=rss-24ff46cbb158------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c2970ee6e0</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Antonio Mennillo]]></dc:creator>
            <pubDate>Wed, 16 Mar 2022 16:22:38 GMT</pubDate>
            <atom:updated>2022-06-03T07:14:17.026Z</atom:updated>
            <content:encoded><![CDATA[<h4>Add amazing animations in your iOS apps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QClnpmvX3beM8PMk" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">Sigmund</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here you will find all the steps that will lead you to create complex and beautiful frame-by-frame animations in SwiftUI without any external framework.</p><h3><strong>Introduction</strong></h3><p>Animations are often essential to make our apps even more beautiful and dynamic, but to insert them we have to resort to external frameworks/pods such as Lottie or similar.</p><p>In this article, you will find instead a very simple method that will allow you to put any type of animation even the most complex <strong><em>without any external tool</em></strong>!</p><h3><em>Create a new Xcode project</em></h3><p>First, we go to create our project, we choose as platform iOS and we go to App, then we write the name of the project and be careful to select SwiftUI as interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4HaZfQDowsDm8VwUpSogw.png" /><figcaption>First Choice</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxO064Ip4Mx4oCdk9pbbVw.png" /><figcaption>Second Choice</figcaption></figure><p>After that, we will have our default Content View and we are ready to implement our code.</p><h3><em>Organize your Assets folder to simplify the code</em></h3><p>Before going to structure our code we must first prepare the assets and this function is <strong><em>essential</em></strong> for the success of the project.</p><p>You have to import all the frames of the animation into the <em>Assets folder</em> but pay attention to how to rename these files.</p><p>The format to follow is: “animation_name” plus “number_of_frame” in our case for example we will have “Robot1”, “Robot2” up to “Robot23” which is the last frame of our animation, you will find out in the next step why this operation is so important!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hom5_COQG0Rfgd1qnF7XQw.png" /><figcaption>Assets Folder</figcaption></figure><p>At the end of this step, you should have the Assets folder similar to the one shown in the image.</p><h3><em>Let’s develop our solution</em></h3><p>After fixing our assets, we can finally develop our code, the logic behind it is very simple but it will surely be able to satisfy your expectations.</p><p>First of all, let’s define a String type animation_name variable that will be the focus of our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*3O1Ua88tovp_R8I1kC7LGg.png" /><figcaption>Animation variable</figcaption></figure><p>Once this is done, let’s define a function that will have the task of defining the speed with which we are going to “animate” our creation, in fact, it will change the value of our string in a certain time interval thanks to an index that will scroll from 1 to the final frame of our animation and when the index reaches the last frame there is a control that brings it back to the beginning so doing the animation will repeat itself indefinitely.</p><p>In this way, we go to call each asset from the first to the last (that’s why we renamed them that way).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mu3eBABPvrlUZepLJ0-hag.png" /><figcaption>Timer Function</figcaption></figure><p>As you can see in our case the timer will change the name of our string and then frame every 0.08 seconds in this way we’ll have a very smooth animation.</p><p>In the end, we have to add our animation in the Content view, first creating a VStack where to insert it, then we put an Image renamed as the previously defined String and add a modifier.OnAppear that will help us to recall each frame every 0.08 seconds, after that our Robot will appear on the screen as a beautiful animation!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6B1FzPGMt7t7e74aO2aGCw.png" /><figcaption>Content View Updated</figcaption></figure><h3>Full Code and Result</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a0d68a347b79fb25a35c3f6a3e35f10/href">https://medium.com/media/5a0d68a347b79fb25a35c3f6a3e35f10/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*GnYgf3Bfu7Pfl-b_ELEHuw.gif" /><figcaption>Final Result 🎉</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c2970ee6e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/how-to-create-amazing-animations-in-swiftui-3c2970ee6e0">How to Add Amazing Frame-by-frame Animations in SwiftUI</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>