This article is originally published at https://swiftsenpai.com on March 26, 2021.
If you are like me, have been using a diffable data source section snapshot for quite some time, I am sure you will notice that the code to construct a section snapshot is actually quite difficult to reason about. The
append(_:to:) API doesn't really show us the hierarchical data structure it represents.
With the release of result builders in Swift 5.4, it makes me wonder is it possible to create a domain-specific language (DSL) that can help us to:
When Apple introduced limited photo access in iOS 14, some iOS developers were not so happy about it. It seemed like Apple was trying to make developers’ lives harder. Any apps (old or new) that want to support iOS 14 or higher will have to handle this extra permission status.
Meanwhile, from the user’s perspective, it is a very welcome change. Users can now have more control over the privacy of their photos, limiting the number of photos an app can access.
With this new permission status, the way to handle photo library permissions in iOS 14 is very different…
This article is originally published at https://swiftsenpai.com on March 10, 2021.
Result builders (formerly known as function builders) is a new feature introduced in Swift 5.4, it is the technology that empowers
ViewBuilder in SwiftUI. With the release of Xcode 12.5 (currently in beta stage), Apple has made it officially available for the developers, allowing us to create our own custom result builders for various kinds of use cases.
In this article, I would like to share with you the basic concept of result builders, how it works, and how you can use it to create your own custom result…
This article is originally published at https://swiftsenpai.com on February 21, 2021.
A couple of months ago, I have wrote an article about “ The Modern Ways to Reload Your Table and Collection View Cells “. The concept is simple, we first identify the desired data source snapshot item, update it, and then apply the changes to the data source snapshot.
When It comes to reloading an expandable list header, things get a little bit trickier. This is because we are now dealing with a diffable data source section snapshot, which is another layer deeper into the data source snapshot.
This article is originally published at https://swiftsenpai.com on February 6, 2021.
As iOS developers, we always tend to use an actual device for testing during app development. A real device can provide an actual hardware environment similar to the production release, it also gives us a better idea about the UI / UX of our app.
However, there are certain times where iOS simulator truly shines, one of them is when debugging complex animation. The “Slow Animations” feature of a simulator can drastically reduce the app animation speed, allowing developers to clearly see the animation’s transition.
This article is originally published at https://swiftsenpai.com on January 25, 2021.
The diffable data source section snapshot is an UIKit component introduced in iOS 14. It opens up new possibilities for developers to build various types of hierarchical lists using collection view declaratively.
Even though it is such a powerful component, Apple’s official documentation does not provide much information on how it works and how to use it effectively.
In this article, I would like to share with you some interesting facts about section snapshot that I recently discovered.
With all the being said, let’s get right into it!
This article is originally published at https://swiftsenpai.com on January 10, 2021.
The expandable date picker is a very common UI component in the Apple design system. You can find it in the iOS Reminder and Calendar App. Even though it does not come out of the box with UIKit, we can easily create one using a custom cell within a table view.
This article is originally published at https://swiftsenpai.com on December 14, 2020.
Recently I have been requested by my client to add a large title navigation bar into their app’s main screen, on top of that the large title should automatically collapse when users start scrolling.
This article is originally published at https://swiftsenpai.com on December 1, 2020.
Recently my team and I are working on an image processing app for a client. The app works pretty well on most of the aspects. Unfortunately, when we start loading HD images on screen, the app will crash occasionally due to “out of memory exception”.
In this article, I would like to share with you the problem we are facing, what is the root cause of the high memory usage and how we manage to reduce the app’s memory footprint using a simple fix recommended by the Apple engineers.
This article is originally published at https://swiftsenpai.com on November 15, 2020.
It’s been awhile since I covered topics related to Lottie animation. In my previous article, “ Modifying Lottie Animation with Value Providers “, I have discussed how developers can leverage different kinds of value providers to manipulate an animation during runtime based on their own needs.
In this article, let’s take a look at another less known yet pretty useful value provider in the Lottie SDK — Text Provider. As you might have guessed, a text provider allows you to change the texts within a Lottie animation during runtime.