Understanding SwiftUI's ViewModifiers and ViewBuilders

It has been more than a year since the release of SwiftUI, and we certainly had some interesting experiences with it so far. It can create a lot of  excitement, surprise, and sometimes a ton of annoyance too. If you have started making apps with SwiftUI, you might have encountered situations where if you used UIKit, the work would be done easily, but with SwiftUI it can sometimes take all day – even more. But since SwiftUI is still a baby, these things shouldn't stop one from learning and unwrapping its mysteries because, with time, it will grow, get better and make our app development way easier.

In this article, we are going to learn two of the key components of SwiftUI, which are ViewModifiers and ViewBuilders. ViewModifiers play a significant role in SwiftUI. Most of the functions called on a SwiftUI View are view modifiers. It is the primary way of modifying a view in SwiftUI. As for ViewBuilders, it is mainly used to create custom container views, which can also become a reusable view component.

In this post, we will take a look at some ready-to-use modifiers, then we will build our own custom view modifier and create a reusable custom container view with ViewBuilder. Using this we can implement gorgeous design systems that are consistent across the entire app and encourage code reusability and good architectural patterns.

Read more


Introducing Diffable Data Source

Ever since the evolution of iOS SDK, it has been the responsibility of the data source, to provide the table-views and collection-views with the data they need to create, configure and display its cells and supplementary views. For this, we are required to implement the necessary protocol (UITableViewDataSource or UICollectionViewDataSource) methods and sync our updated data-model with the data source properly to avoid any synchronization bugs. This approach has been used for a decade now but still, it has quirks and fallout which could sometimes give you a headache.

With iOS 13.0, Apple provided a couple of really cool API’s for both table-views and collection-views. One of these cool features is Diffable Data Sources. In today’s article, I will show you how to use UICollectionViewDiffableDataSource to drive your collection-views. By the end of this article, you will know exactly how to use Diffable Data Sources and what their caveats are. But before that let’s discuss and understand why Apple had to provide a brand new API for data sources. Let’s dive in!

Read more


What's New in Core Location

Apple showcased a lot of major changes in WWDC19, with SwiftUI creating a lot of buzz among the developers. But there were also some other changes that are important and will be affecting the user experience right now. One of them is the updates in the Core Location framework.

iOS 13 improves user privacy related to location sharing. If your app needs the location of the user to recommend or display content, you may need to investigate if your app is still running properly.

Starting from iOS 13, users will be getting a new option to share their location just once. They’ve also empowered While in Use permission and changed many other things. Assuming that you have already worked with Core Location before, let's discuss the updates in detail.

Read more


Vinsol Ranked Among The Top iOS & Android App Development Companies In 2019

$200 Billion. That’s the number that mobile app economy is poised to register globally in 2021. From $50 Billion in 2012, various forms of monetization models in the smartphone industry have contributed to an immense surge in the ecosystem of consumers, enigmatic product innovations, and the profession of app development itself.

Read more


Building your first app - Should it be on iOS or Android

Whether you have a great idea to serve the general population or a quirky resolution to a problem that a particular set of audience faces, making a mobile app has become a necessity for a number of businesses.

Smartphones enable us to access unlimited information, make connections, and use the internet on-the-go to work on complex production tasks. Some of us would argue that the global smartphone market is oversaturated, but we believe in facts that prove this otherwise. It is because a lot of unimaginable ways are being invented for ease of doing business and mobile apps have a huge potential in the future to make our lives better.

Read more