Top 8 SwiftUI libraries to use in 2021

Last updated 10 October 2021

SwiftUI has changed how we design, develop, and think about iOS development. After making its first debut at WWDC 2019, Apple introduced a bunch of new views and property wrappers at WWDC 2020 and 2021. However, the declarative framework is still in the very early stage. SwiftUI's bugs and limitations make it tricy to use alone (without UIKit) in production. Regardless, a lot of iOS developers have jumped on the fast moving train and built amazing libraries that can help you build your SwiftUI apps. In this article, I would like to share 8 amazing libraries that you can use in your current or next project.

ActivityIndicatorView

Even though SwiftUI has its own ProgressView to display indeterminate loader, it cannot be freely customised. With the help of ActivityIndicatorView library, developers can easily display and customise loading indicators to use in their app.

You can displaying a loading indicator using library as simple as this:

ActivityIndicatorView(isVisible: $showLoadingIndicator, type: .default)

To read more about this library, you can visit its GitHub repository here.

ChartView

You most likely will find charts in most apps today, especially financial apps. Besides providing eye-pleasing visuals, charts useful in displaying time series data such as stocks and cryptocurrencies. ChartView helps you effortlessly integrate various type of charts into your application.

To read more about this library, you can visit its GitHub repository here.

Liquid

Splash screen is an essential part in any app. Often, teams hire professional animators or designers to create eye-caching artwork for their splash screen. Thankfully, Michael Verges came up with his initiative to build an open-source SwiftUI library to help us easily build splash screens without the help of any professional animators or designers. Liquid lets you integrate liquid animated backsplash views in your SwiftUI project by simply using Liquid() custom view.

struct ContentView: View {
    var body: some View {
        Liquid().frame(width: 200, height: 200)
    }
}

To read more about this library, you can visit its GitHub repository here.

MarkdownUI

Markdown has become the most favourite syntax to write formatted text on the web. However, SwiftUI lacks this essential tool. Even though you can use UITextView from UIKit by using the UIViewRepresentable protocol, a built-in SwiftUI custom view would be easier to use. Thankfully, there is a library for rendering markdown in SwiftUI called MarkdownUI.

You can create a markdown view in SwiftUI by writing this simple code:

Markdown(
    #"""
    It's very easy to make some words **bold** and other words *italic* with Markdown.

    **Want to experiment with Markdown?** Play with the [reference CommonMark
    implementation](https://spec.commonmark.org/dingus/).
    """#
)

To read more about this library, you can visit its GitHub repository here.

PopupView

This one is another amazing open-source library created by Exyte to help developers display toasts and popups in SwiftUI. Toasts and popups are essential components to give feedback to users. For example, when users try to log in and they enter a wrong email or password, we want to display error message to let them know that they enter wrong details. With toasts and popups, we can display the error message with a nice user experience.

To read more about this library, you can visit its GitHub repository here.

SlideOverCard

A card that pops up from the bottom of the screen is a design pattern that is increasingly being adopted by iOS developers. This design pattern can be seen in HomeKit, AirPods, Apple Card and AirTag setup, NFC scanning, Wi-Fi password sharing and more. SlideOverCard is a library that helps developers to integrate this design pattern in their SwiftUI apps. There are two ways to use SlideOverCard: .slideOverCard() modifier and SlideOverCard custom view.

To read more about this library, you can visit its GitHub repository here.

StepperView

Steppers are an essential component of apps today to display a timeline or progress. You can easily find this in delivery apps. Unfortunately, SwiftUI does not have this component by default. But, this library solves that issue by providing out-of-the-box support for StepperView. You can quickly add vertical or horizontal steppers in your app by using this library.

To read more about this library, you can visit its GitHub repository here.

SwiftUICharts

Last but not least, there is another great open-source charts library made by Majid Jabrayilov. In addition to writing this library, he also writes weekly posts about Swift development in his website and twitter @mecid.

To read more about this library, you can visit its GitHub repository here.