<?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 Eddie Char on Medium]]></title>
        <description><![CDATA[Stories by Eddie Char on Medium]]></description>
        <link>https://medium.com/@eddiechar?source=rss-e95c9c4ff273------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hUzb1EyywRT-LTAmVzRJDg.jpeg</url>
            <title>Stories by Eddie Char on Medium</title>
            <link>https://medium.com/@eddiechar?source=rss-e95c9c4ff273------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:50:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eddiechar/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[Color theory in iOS apps]]></title>
            <link>https://medium.com/design-bootcamp/color-theory-in-ios-apps-d7dbf7d6e22b?source=rss-e95c9c4ff273------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7dbf7d6e22b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[colors]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Eddie Char]]></dc:creator>
            <pubDate>Tue, 21 Jun 2022 07:03:59 GMT</pubDate>
            <atom:updated>2025-03-16T18:40:42.030Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re anything like me, the UI design portion of the app creation process tends to take a backseat to the programming logic, algorithm design, you know… the fun stuff. While the programming aspect is an important factor in software development, UI design is just as important. Therefore, a well-rounded software developer should be proficient in both, programming and UI design. Specifically, this article will explore the use of color to strike an emotional chord, and color combinations to provide a coherent, visually attractive final product for your users. Let’s dive in!</p><h3>Color Themes</h3><figure><img alt="Rainbow color palette with overall themes and ideas associated with each color" src="https://cdn-images-1.medium.com/max/840/1*PZqzfFavBzfCMEL6mQq2RA.jpeg" /></figure><p>Studies have shown that certain colors evoke certain emotions. Red for instance conveys love, passion, and intensity. Ads for a sports car or lipstick might use this color palette. Yellow on the other hand evokes warmth and cheeriness — think ad for the beach or a summer vacation getaway. When choosing a primary color for your app, it should correlate to the product you are selling. Taxi service? Yellow is an obvious choice. The next social media sensation? Maybe orange. <a href="https://apps.apple.com/us/app/pocket-planetarium/id1532774983">Astronomy AR app</a>? Try blue. Below is a list of main color descriptions, suggested uses, and apps/brands that effectively use these colors (source: <a href="https://www.frankwbaker.com/mlc/advertising-color-meaning/">https://www.frankwbaker.com/mlc/advertising-color-meaning/</a>):</p><figure><img alt="Apps and Brands that use the color red in their logo: Coca Cola, Target, GrubHub, McDonalds, Yelp, and Netflix" src="https://cdn-images-1.medium.com/max/690/1*GGqQHFLyt6YmzPpFhk_k2Q.png" /></figure><p><strong>Red</strong> is an emotionally intense color. It has high visibility, which is why stop signs, traffic lights, and fire trucks are usually painted red. Since red brings text and images to the foreground, you can use it as an accent color to stimulate people to make quick decisions; it is a perfect color for ‘Buy Now’ or ‘Click Here’ buttons on Internet banners and websites. Red is widely used to indicate danger (high voltage signs, traffic lights). It is also commonly associated with energy, so you can use it when promoting energy drinks, games, cars, items related to sports and high physical activity.</p><figure><img alt="Apps and Brands that use the color orange in their logo:Amazon, Firefox, Home Depot, Fanta, Nickelodeon, and iBooks" src="https://cdn-images-1.medium.com/max/690/1*0B2ub0izBJpSX8WwufYDKA.png" /></figure><p><strong>Orange</strong> combines the energy of red and the happiness of yellow. It is associated with joy, sunshine, and the tropics. Orange represents enthusiasm, fascination, happiness, creativity, determination, attraction, success, encouragement, and stimulation. It is a very hot color to the human eye, so it gives the sensation of heat. Orange increases oxygen supply to the brain, produces an invigorating effect, and stimulates mental activity. It is highly accepted among young people. As a citrus color, orange is associated with healthy food and stimulates appetite. Orange is very effective for promoting food products and toys.</p><figure><img alt="Apps and Brands that use the color yellow in their logo: Snapchat, Sprint, Forever 21, Yellow Pages, Lay’s, and Yubo" src="https://cdn-images-1.medium.com/max/690/1*WTwEiiv63AxpJKYmNCwpgg.png" /></figure><p><strong>Yellow</strong> is the color of sunshine. It’s associated with joy, happiness, intellect, and energy. Yellow produces a warming effect, arouses cheerfulness, stimulates mental activity, and generates muscle energy. Use yellow to evoke pleasant, cheerful feelings. You can choose yellow to promote children’s products and items related to leisure. Yellow is very effective for attracting attention, so use it to highlight the most important elements of your design. On the other hand, yellow is an unstable and spontaneous color, so avoid using yellow if you want to suggest stability and safety. Light yellow tends to disappear into white, so it usually needs a dark color to highlight it.</p><figure><img alt="Apps and Brands that use the color green in their logo: Spotify, Mint, Starbucks, CashApp, Quickbooks, and WhatsApp" src="https://cdn-images-1.medium.com/max/690/1*2EDpWAIZNV20GYS3t5kCiw.png" /></figure><p><strong>Green</strong> is the color of nature. It symbolizes growth, harmony, freshness, and fertility. Green has strong emotional correspondence with safety. Dark green is also commonly associated with money. Green has great healing power. Green suggests stability and endurance. Green, as opposed to red, means safety; it is the color of free passage in road traffic. Use green to indicate safety when advertising drugs and medical products. Green is directly related to nature, so you can use it to promote ‘green’ products. Dull, darker green is commonly associated with money, the financial world, banking, and Wall Street.</p><figure><img alt="Apps and Brands that use the color blue in their logo: Facebook, MyFitnessPal, Twitter, United, Blue Shield, and Best Buy" src="https://cdn-images-1.medium.com/max/690/1*g2-o1UwbqUlQaGDpaxiNzg.png" /></figure><p><strong>Blue</strong> is the color of the sky and sea. It is often associated with depth and stability. It symbolizes trust, loyalty, wisdom, confidence, intelligence, faith, truth, and heaven. Blue is considered beneficial to the mind and body. It slows human metabolism and produces a calming effect. Blue is strongly associated with tranquility and calmness. You can use blue to promote products and services related to cleanliness (water purification filters, cleaning liquids), air and sky (airlines, airports), water and sea (sea voyages, mineral water). As opposed to emotionally warm colors like red, orange, and yellow, blue is linked to consciousness and intellect. Use blue to suggest precision when promoting high-tech products.</p><figure><img alt="Apps and Brands that use the color purple in their logo: Twitch, FedEx, Curves, Podcasts, Amazon Music, and iMovie" src="https://cdn-images-1.medium.com/max/690/1*wtQ57DWXUXAJSORZ1oUCPQ.png" /></figure><p><strong>Purple</strong> combines the stability of blue and the energy of red. Purple is associated with royalty. It symbolizes power, nobility, luxury, and ambition. It conveys wealth and extravagance. Purple is associated with wisdom, dignity, independence, creativity, mystery, and magic. Light purple is a good choice for a feminine design. You can use bright purple when promoting children’s products.</p><p>As you can see, color can dramatically enhance your storytelling. With your product in mind, what emotions and ideas do you want your users to feel?</p><h3>Color Combinations</h3><figure><img alt="Color wheel diagram with four color combinations: analogous, complementary, triadic, and split complementary" src="https://cdn-images-1.medium.com/max/614/1*cncewpUaaDzuQcCohlMHqQ.jpeg" /></figure><p>In addition to choosing the perfect color for your app, there’s an added layer of complexity when considering combining two or more colors. Although there’s no law saying you can’t combine magenta with cyan and lime green, there is a theory to which colors, when combined, produce the most harmonious results. Recalling back to your elementary school days when you were first introduced to the color wheel, there are specific combinations and “rules” on how to combine colors. Below are some of the widely accepted color combinations you can produce, along with an implementation you can use for your own projects.</p><p><em>This tutorial assumes you have knowledge in creating iOS apps. If you don’t, you can find numerous tutorials and academies online to get you started on your journey.</em></p><p>Let’s start by adding a new .swift file to your project. To this file add a UIColor extension class. From here, you will add the below helper function and computed properties in order to utilize these four color combinations: complementary, split complementary, triadic, and analogous.</p><h4>Helper Function</h4><pre>extension UIColor {<br>   private func withHueOffset(_ offset: CGFloat) -&gt; UIColor {<br>      //1<br>      var hue: CGFloat = 0<br>      var saturation: CGFloat = 0<br>      var brightness: CGFloat = 0<br>      var alpha: CGFloat = 0</pre><pre>      //2   <br>      self.getHue(&amp;hue, <br>                  saturation: &amp;saturation, <br>                  brightness: &amp;brightness, <br>                  alpha: &amp;alpha)</pre><pre>      //3<br>      return UIColor(hue: fmod(hue + offset, 1),<br>                     saturation: saturation,<br>                     brightness: brightness,<br>                     alpha: alpha)<br>   }<br>}</pre><p>Here’s what’s happening:</p><ol><li>Initializes the hue, saturation, brightness, and alpha properties to 0.</li><li>Calls self.getHue(), which takes the color you are trying to combine and sets the properties you declared in #1 via <a href="https://docs.swift.org/swift-book/LanguageGuide/Functions.html">in-out</a> parameters.</li><li>Returns the <em>offset</em> hue based on the argument passed in your function using the <a href="https://developer.apple.com/documentation/accelerate/fmod">fmod</a> function.</li></ol><p>This helper function will be reused in the below <a href="https://docs.swift.org/swift-book/LanguageGuide/Properties.html">computed properties</a>. Now add these properties to your UIColor extension:</p><h4>Complementary Colors</h4><p>The complement of a given color is the color diametrically opposed to it, i.e. 180 degrees away. For instance, the complementary color to green is red. You can use the new helper function we created above to simply pass the offset, 180/360, or 0.5, to it.</p><p><em>In these cases, I like to leave the computation in place (180/360 versus 0.5). It helps to “see” the offset amount in degrees with respect to the 360 degree circle.</em></p><pre>var complementary: UIColor {<br>   return self.withHueOffset(180/360)<br>}</pre><h4>Split Complementary Colors</h4><p>The split complements of a given color are equal to 150 degrees and 210 degrees away from the original color. Since two colors are produced in split complementary, we return a <a href="https://docs.swift.org/swift-book/ReferenceManual/Types.html">tuple</a>, one for each color, which we label <em>first</em> and <em>second.</em></p><pre>var splitComplementary: (first: UIColor, second: UIColor) {<br>   return (self.withHueOffset(150/360), <br>           self.withHueOffset(210/360))<br>}</pre><h4>Triadic Colors</h4><p>Similar to split complementary, triadic colors produce two other colors, however triadic colors are 60 degrees away from each other, like an equilateral triangle. Put another way, the first triadic color is 120 degrees away from the original color, and the second is 240 degrees away. The triadic colors of green are the secondary colors, purple and orange, as in the diagram above.</p><pre>var triadic: (first: UIColor, second: UIColor) {<br>   return (self.withHueOffset(120/360), <br>           self.withHueOffset(240/360))<br>}</pre><h4>Analogous Colors</h4><p>Analogous colors are the two colors immediately to the left and right of the original color (-30 and 30 degrees, respectively). Analogous colors create a monochromatic look, as opposed to the harsher combination of complementary colors.</p><pre>var analogous: (first: UIColor, second: UIColor) {<br>   return (self.withHueOffset(-30/360), <br>           self.withHueOffset(30/360))<br>}</pre><h4>Usage</h4><p>Now that you’ve added these properties to your UIColor extension, you can use them in the following way:</p><pre>//creates the complementary color of red, i.e. green<br>let redComplement = UIColor.red.complementary</pre><pre>//creates the triadic and complementary colors of the custom myColor<br>let myColor = UIColor(red: 25/255, <br>                      green: 50/255,<br>                      blue: 130/255, <br>                      alpha: 1)<br>let myColorTriadic1 = myColor.triadic.first<br>let myColorTriadic2 = myColor.triadic.second<br>let myColorComplement = myColor.complementary</pre><p>Keep in mind, these computed properties were created based on well-established color combinations. You are not limited to these combinations however, and I encourage you to try tweaking the offset values to create your own custom combination.</p><p>Below is the complete UIColor extension implementation:</p><pre>extension UIColor {<br>   var complementary: UIColor {<br>      return self.withHueOffset(180/360)<br>   }</pre><pre>   var splitComplementary: (first: UIColor, second: UIColor) {<br>      return (self.withHueOffset(150/360), <br>              self.withHueOffset(210/360))<br>   }</pre><pre>   var triadic: (first: UIColor, second: UIColor) {<br>      return (self.withHueOffset(120/360), <br>              self.withHueOffset(240/360))<br>   }</pre><pre>   var analogous: (first: UIColor, second: UIColor) {<br>      return (self.withHueOffset(-30/360), <br>              self.withHueOffset(30/360))<br>   }</pre><pre>   var myFunkyCombo: (first: UIColor, second: UIColor) {<br>      return (self.withHueOffset(35/360),<br>              self.withHueOffset(132/360))<br>   }</pre><pre>   private func withHueOffset(_ offset: CGFloat) -&gt; UIColor {<br>      var hue: CGFloat = 0<br>      var saturation: CGFloat = 0<br>      var brightness: CGFloat = 0<br>      var alpha: CGFloat = 0</pre><pre>      self.getHue(&amp;hue, <br>                  saturation: &amp;saturation, <br>                  brightness: &amp;brightness, <br>                  alpha: &amp;alpha)</pre><pre>      return UIColor(hue: fmod(hue + offset, 1),<br>                     saturation: saturation,<br>                     brightness: brightness,<br>                     alpha: alpha)<br>   }<br>}</pre><p>And here are variations of my calculator app, with the operations buttons on the right in accent colors that use the four color combinations, with respect to the primary buttons in <a href="https://www.colorhexa.com/ba6e7f">slightly desaturated red</a>:</p><figure><img alt="Calculator app with accent buttons in four different color combos: complementary, split complementary, triadic, and analogous" src="https://cdn-images-1.medium.com/max/800/1*DwzIZeJ7EGj3vcdr4xOgSw.png" /></figure><h3>My Favorite Websites</h3><p>I have curated a short list of websites that I have found to be beneficial in my never-ending search for aesthetically pleasing designs and cool color combos. Feel free to add these to your design arsenal:</p><p><a href="https://www.colorhexa.com/"><strong>https://www.colorhexa.com</strong></a>: search any color value by name, hex value or rgb values. Also gives you the complementary, split complementary, triadic, tetradic and analogous colors.</p><p><a href="https://flatuicolors.com/"><strong>https://flatuicolors.com</strong></a>: provides you with sample color palettes that you can use in your projects. Great website for if you need help selecting eye-catching color combinations.</p><p><a href="https://99designs.com/blog/tips/designers-need-to-understand-color-blindness/"><strong>https://99designs.com/blog/tips/designers-need-to-understand-color-blindness/</strong></a>: great blog for understanding the purpose of colors with respect to users who are colorblind, and having this awareness when designing your UI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7dbf7d6e22b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/color-theory-in-ios-apps-d7dbf7d6e22b">Color theory in iOS apps</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS Animation]]></title>
            <link>https://medium.com/@eddiechar/ios-animation-db641444b689?source=rss-e95c9c4ff273------2</link>
            <guid isPermaLink="false">https://medium.com/p/db641444b689</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[view-controller]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Eddie Char]]></dc:creator>
            <pubDate>Mon, 07 Mar 2022 23:40:29 GMT</pubDate>
            <atom:updated>2022-06-29T06:15:28.771Z</atom:updated>
            <content:encoded><![CDATA[<p>Incorporating UIView animations into your project can transform a decent app into an exceptional one. Any subclass that inherits from UIView — labels, text fields, image views, buttons — can be animated, from its size, to its alpha component, to its position in the view. In this tutorial, you will learn how to apply animations to your views and give your app some flair.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2Fbe4c144593684ff7bc30d084615686d2&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2Fbe4c144593684ff7bc30d084615686d2&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2Fbe4c144593684ff7bc30d084615686d2-00001.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="960" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/dea02d49a5c2c9163aca9bf3be21c203/href">https://medium.com/media/dea02d49a5c2c9163aca9bf3be21c203/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2F7eb20151d44446d897988dca6ba63564&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2F7eb20151d44446d897988dca6ba63564&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2F7eb20151d44446d897988dca6ba63564-00001.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="960" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e1714fb6d83e500ae3ab5cd240ec593/href">https://medium.com/media/9e1714fb6d83e500ae3ab5cd240ec593/href</a></iframe><p>Almost any class that inherits from UIView is animatable: labels, image views, and text fields, for example. From the object’s size, to its alpha component, to its position in the view you can attach an animation and set the various parameters such as the length of the animation, the delay before the animation begins (for example if you want to chain it with other animations in a sequence), and animation options (more on this below).</p><p>Various properties of UIView can be animated. In Xcode, if you Option-click a property in your code, it should tell you if the property is animatable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*S5al-OfLR3vtZoQ_lNRY_A.png" /><figcaption>Option + left-click a UIView property in Xcode to read more about it.</figcaption></figure><p>To animate the alpha component, set the initial alpha component value. Then wrap the final value within the animate closure of UIView.animate(). The code below makes label disappear in a duration of 1 second:</p><pre>let label = UILabel()<br>label.text = &quot;My Label&quot;<br>label.alpha = 1.0</pre><pre>UIView.animate(duration: 1.0) {<br>   label.alpha = 0.0<br>}</pre><p>You can animate other properties as well. The code below chains animations together by setting a delay based off of the duration from the previous animation:</p><pre><strong>import</strong> UIKit</pre><pre><strong>class</strong> ViewController: UIViewController {<br>   <strong>var</strong> label = UILabel()</pre><pre><strong>   override</strong> <strong>func</strong> viewDidLoad() {<br>      <strong>super</strong>.viewDidLoad()</pre><pre>      label.text = &quot;Hammer&quot;<br>      label.frame = CGRect(x: 0, <br>                           y: view.frame.height / 2 - 20, <br>                           width: 100, <br>                           height: 40)</pre><pre>      view.addSubview(label)<br>   }</pre><pre><strong>   override</strong> <strong>func</strong> viewDidAppear(_ animated: Bool) {<br>      <strong>super</strong>.viewDidAppear(animated)</pre><pre>      //1<br>      UIView.animate(withDuration: 1.0, <br>                     delay: 0.0, <br>                     options: .curveEaseIn, <br>                     animations: {<br>         <strong>self</strong>.label.frame.origin.x = <strong>self</strong>.view.frame.width / 2 - 50<br>      }, completion: <strong>nil</strong>)</pre><pre>      //2<br>      UIView.animate(withDuration: 0.5, <br>                     delay: 1.5, <br>                     options: .curveEaseInOut,<br>                     animations: {<br>         <strong>self</strong>.label.transform = CGAffineTransform(<br>            rotationAngle: .pi / 2)<br>      }, completion: <strong>nil</strong>)</pre><pre>      //3<br>      UIView.animate(withDuration: 1.5, <br>                     delay: 2.0, <br>                     usingSpringWithDamping: 0.1,<br>                     initialSpringVelocity: 20,<br>                     options: .curveEaseInOut,<br>                     animations: {<br>         <strong>self</strong>.label.transform = CGAffineTransform(rotationAngle: 0)<br>      }, completion: <strong>nil</strong>)</pre><pre>      //4<br>     UIView.animate(withDuration: 1.0, <br>                     delay: 3.5, <br>                     options: .curveEaseInOut,<br>                     animations: {<br>         <strong>self</strong>.label.alpha = 0.0<br>      }, completion: { _ <strong>in<br>         </strong>print(&quot;Animation complete.&quot;)<br>      })<br>   }<br>}</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2F72fdf6c00c0f41ca940eba1a267354a0&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2F72fdf6c00c0f41ca940eba1a267354a0&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2F72fdf6c00c0f41ca940eba1a267354a0-00001.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="960" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/a337c1c0ad087b49bdb0ed5dd066dfe8/href">https://medium.com/media/a337c1c0ad087b49bdb0ed5dd066dfe8/href</a></iframe><p>Here’s what’s happening:</p><ol><li>Animate the label from the left side of the screen to about halfway across in 1 second</li><li>Then rotate the label 90 degrees clockwise in 0.5 second</li><li>Rotate the label back to 0 degrees counter-clockwise in 1.5 seconds. Here I’ve also included 2 more arguments in the animate function: usingSringWithDamping and initalSpringVelocity. These two optional arguments add a “bouncy” effect to your animation. Feel free to experiment with these values to get the look you want in your animation.</li><li>Finally, fade the label out, and print “Animation complete.”</li></ol><p>Below is an explanation of the arguments used in the animate() function:</p><pre>UIView.animate(withDuration: <strong>TimeInterval</strong>, <br>               delay: <strong>TimeInterval</strong>, <br>               usingSpringWithDamping: <strong>CGFloat</strong>, <br>               initialSpringVelocity: <strong>CGFloat</strong>, <br>               options: <strong>UIView.AnimationOptions</strong>, <br>               animations: <strong>() -&gt; Void</strong>, <br>               completion: <strong>((Bool) -&gt; Void)?</strong>)</pre><ul><li><strong>withDuration</strong>: the length of the animation in seconds</li><li><strong>delay</strong>: adds a delay in seconds before the animation begins</li><li><strong>usingSpringWithDamping</strong>: The damping ratio for the spring animation as it approaches its quiescent state. To smoothly decelerate the animation without oscillation, use a value of 1. Employ a damping ratio closer to zero to increase oscillation.</li><li><strong>initialSpringVelocity</strong>: For a smooth start to the animation, match this value to the view’s velocity as it was prior to attachment. A value of 1 corresponds to the total animation distance traversed in one second. For example, if the total animation distance is 200 points and you want the start of the animation to match a view velocity of 100 pt/s, use a value of 0.5</li><li><strong>options</strong>: various pre-defined options you can attach to your animation that gives it a certain look and feel. When using an option, you can omit the spring spring damping and velocity as they tend to dilute any options you set here. Here are some common options you can use:<br><strong>.curveLinear</strong>: adds an even animation throughout the duration of the animation<br><strong>.curveEaseIn</strong>: causes the animation to begin slowly, then speed up as it progresses<br><strong>.curveEaseOut</strong>: causes the animation to begin quickly, then slows as it completes<br><strong>.curveEaseInOut</strong>: causes the animation to begin slowly, accelerate through the middle of its duration, and then slow again before completing</li><li><strong>animations</strong>: enter your animatable code within this closure. (Learn more about closures <a href="https://docs.swift.org/swift-book/LanguageGuide/Closures.html">here</a>).</li><li><strong>completion</strong>: you can enter code within this closure to execute once the animation code completes, or enter nil to omit the completion closure.</li></ul><h4>Summary</h4><p>Adding animations can liven up your app and give it some flair. Almost any property within UIView can be animated; Option-clicking in your code in Xcode will bring up a window that shows you if the property is animatable. Use the UIView.animate() function to add an animation to your property. While you can have a lot of fun customizing animations, you might want to consider these points:</p><ul><li>Less is more. A simple animation can be very effective. Just don’t overdo it.</li><li>Don’t sacrifice performance. While a complex animation looks cool, if it hinders the UI, or if the user has to view it over and over again and it doesn’t really add value, this may affect your app’s user retention rate.</li><li>Use animation to show intent. For example, you can animate hint bubbles to illustrate how your app is to be used, and how it should flow.</li></ul><p>Have fun animating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db641444b689" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>