How to Make a Modified AppStore-like Animation
Content:
  • 1. 👨‍💻 Step 1: Setup a Layout
  • 2. ⚙️ Step 2: Developing the Animation
  • 3. 🛠️ Step 3: Adding a Modification to Our Animation
  • 4. 🏆 And Finally…
  • In the mobile world everybody knows how a great UI may increase user engagement, retention rates and overall delight from using your application. And it’s impossible to imagine any really cool design without beautiful animations. So today we’re going to build one on our own!

    More specifically, we're going to share with you our insights on how to make the nice AppStore-like animation with some interesting modifications. Let’s get it started!



    👨‍💻 Step 1: Setup a Layout

    AppStore-animation

    Looks pretty good, doesn’t it? We're going to develop a similar one!

    First, let’s make a simple UI for our demo app. Since we’re developing it for iOS devices, our interface should be similar to AppStore’s UI.

    NOTE: We're not aiming to make a perfect, scalable layout. The main goal is just to make a cool animation.

    layout

    Our layout

    Now let’s do some usual setup in our code:

    At the moment our newly created demo app looks like this:

    demo

    That's how our demo looks now

    Finally, we have something to work with and are ready to create the outstanding AppStore-like animation. Let’s take a closer look at what should be done.



    ⚙️ Step 2: Developing the Animation

    So what do we expect from our animation?

    When you select a cell, this is what you should see:

    • The selected cell expands to the full screen;
    • Its corner radius equals 0;
    • The status bar is hidden;
    • The collection view’s isScrollEnabled is false.

    When you tap again on the selected cell, the following things should happen:

    • The selected cell collapses to its initial frame;
    • The selected cell’s corner radius is back to its initial value;
    • The status bar is visible again;
    • The collection view’s isScrollEnabled is true.

    So, if we translate this into the coding language, it will look similar to this:

    Seems quite good. But where is the main part - our cool animation? It’s right here! 🙂

    To build it, we’ll use UIViewPropertyAnimator. If you aren't familiar with it, we recommend you to go and check it out right now. It’s a truly awesome thing!

    But let’s come back to our animation. To develop it, we will use UISpringTimingParameters, because it’s very similar to what Apple uses to create the animation in AppStore. Also, we’ll disable user interactions while the selected cell animates to avoid any unexpected behaviour. And then the code should be like the following:

    Let’s see what we already done. That’s how cool we are:

    card-left

    Hmm, looks like we forgot about the fact that each next cell is higher at the layer level than the previous one. At that moment we thought: what if… we’ll solve this problem and add a cool feature at the same moment?

    Namely, we’ll force visible cells (except the selected one) to hide from the screen. Eventually, it should seem that the selected cell pushes the remaining cells off the screen. Let’s implement it and check how it looks!



    🛠️ Step 3: Adding a Modification to Our Animation

    First, we will add a new property called hiddenCells. We need to remember which cells will be hidden, so that later we can show them back on the screen.

    private var hiddenCells: [ExpandableCell] = []

    And now imagine that our cells have “show” and “hide” methods. In this case the changes are really simple and should look similar to the snippet below:

    Also, let’s take a closer look at what should be done in “show” and “hide” methods.

    Hide Show
    The cell should hide from the screen, and if it was above the selected one, it should go up, otherwise - it should go down (this is needed to create an effect when the selected cell kinda pushes all others off the screen). The cell should back to its initial frame.

    To understand where exactly the hidden cells should move to, here is a small blueprint for you:

    blueprint

    This is how hidden cells move

    There's nothing complicated, so the code will look pretty simple, like the one below:

    Read Also Guide: How to Find and Hire Expert Remote iOS Developers for Your App?



    🏆 And Finally…

    Let's see our final version!

    open-close-animation

    The final version of our animation

    We did a great job since it really looks nice!

    We hope you enjoyed this article. You can also check the full project on our GitHub.

    If you have any questions, we will gladly answer them. Also we’re open to any suggestions so feel free to share some. All this you can do by hitting the button below. Have a nice day! :)

    {"value":[4.4,4.7],"count":[2,27],"from":"2018-04-19"}
    quote
    Drop Us a Line!
    Rate this Article:
    (27 ratings, average: 4.7 out of 5)
    Thank you for your vote!
    How Mobile Apps Help to Increase Reach, Retention & Engagement in the Fitness Industry
    17 min read

    Cover image by Martin Mroč Many offline businesses in the fitness industry come to the point where they wonder: “What else can I do?”. They’re well-known, have loyal clients, and make good revenue. Some decide to open a new fitness studio but in another area, for instance. Yet, it

    How to Make Sure Your App or Website is HIPAA, PIPEDA & GDPR Compliant
    28 min read

    Cover image by DarkCube Studio Cybersecurity is crucial for any industry. Today most countries have their own data privacy regulations that you have no choice but to comply with. In the modern globalized world, things are even trickier: you may be a legal entity of country A, mostly operate in

    Telemedicine Platform Development: How to Make a Telehealth App or Site
    16 min read

    Cover image by Anastasia Nowadays healthcare is developing rapidly: millions of dollars are invested in research and the progress is made every day. The global telemedicine market is expected to reach $175.5 million by 2026. Despite this, many countryside regions and third-world countries are suffering from the poor healthcare

    How can we help you?

    If we can't do it, no one else can.

    Name*
    Email*
    Please tell us about your project*

    Thanks!

    We'll come back to you regarding your project within 24 hours. Meanwhile, please check some insights from our blog:

    How Mobile Apps Help to Increase Reach, Retention & Engagement in the Fitness Industry
    17 min read

    Cover image by Martin Mroč Many offline businesses in the fitness industry come to the point where they wonder: “What else can I do?”. They’re well-known, have loyal clients, and make good revenue. Some decide to open a new fitness studio but in another area, for instance. Yet, it

    How to Make Sure Your App or Website is HIPAA, PIPEDA & GDPR Compliant
    28 min read

    Cover image by DarkCube Studio Cybersecurity is crucial for any industry. Today most countries have their own data privacy regulations that you have no choice but to comply with. In the modern globalized world, things are even trickier: you may be a legal entity of country A, mostly operate in

    Telemedicine Platform Development: How to Make a Telehealth App or Site
    16 min read

    Cover image by Anastasia Nowadays healthcare is developing rapidly: millions of dollars are invested in research and the progress is made every day. The global telemedicine market is expected to reach $175.5 million by 2026. Despite this, many countryside regions and third-world countries are suffering from the poor healthcare

    Search

    0 results. Try changing your query.