I am an Apple fanboy and I admit that. But one of the most frustrating things in being an app developer is dealing with the App Store review and compliance teams. This time I would like to share my experience with these problems.

Even Apple’s former app approval chief has said that he is ‘really worried’ about the company’s anticompetitive behavior.

Navigating from one view to another, or simply showing a title and buttons, is one of the most crucial building blocks of modern iOS applications. Almost every app has this feature. SwiftUI brings some new approaches for how to show the Navigation Bar, set the title, and add buttons. So let’s check it out.

Photo by Egor Myznik on Unsplash.

Showing Navigation View

To show a Navigation Bar using SwiftUI, we should use the NavigationView component that is responsible for this purpose. It requires that we provide the Content that is a View type. The Content can be anything from a text field to scrollable content. …

Explore the various styles and select the desired tab programmatically

Phone and laptop on desk
Phone and laptop on desk
Photo by Sigmund on Unsplash.

The tab bar is a vital component of iOS and has been since iOS 2.0. This element appears at the bottom of iOS and iPadOS devices and allows our app users to switch between different views or functions quickly.

It is a major element of Apple’s apps, like Music, Podcasts, and the App Store.

Showing and hiding some parts of information is a vital feature in mobile apps, especially considering that phone screens are much smaller than those on laptops or desktop computers.

Photo by Jonas Jacobsson on Unsplash.

Now with the new SwiftUI capabilities, we can collapse content with DisclosureGroup. Let's see how we could use it in various ways.

Display a collapsable content

Let’s start with the most straightforward way to set up a collapsable view that we could show or hide. It comes with a disclosure arrow indicator and nice animation.

In this blog post, let’s use an example showing weather conditions that would be a SwiftUI view WeatherDetailsView and show…

Build intuitive iOS apps

Bridge with traffic sign
Bridge with traffic sign
Photo by Evan Krause on Unsplash.

Alerts are one of the most crucial building blocks of iOS applications. We can use them to inform users about an error if something requires more time, like downloading a file or ensuring that everything is OK. Another use case with alerts is asking for confirmation when our app users want to delete something or make a wire transfer.

SwiftUI has the Alert component for this, and there are a few ways to use it. Let's check them out.


One of the easiest ways to show an alert with SwiftUI is to have a local state variable to indicate if…

This time, we will look at a couple of ways to show a text label inside a circle using SwiftUI. We will dig deeper into three different ways using the ZStack view, .background and .overlay modifiers. In the end, as a small bonus, we will check out how to present a text label over a circle using the .clipShape modifier.

Photo by Octavio Fossatti on Unsplash.

Our end goal is something like this:

Selecting images from our iPhone library is needed when changing a profile picture, posting an update, or sharing the photo of your pet. In this post, we are going to look into how to use PHPickerViewController with SwiftUI. Apple announced this view controller at WWDC2020.

Photo by Dan Gold on Unsplash.

What is PHPickerViewController?

PHPickerViewController is a view controller that gives way for our app users to pick assets from their photo library. It provides a well-known user interface, and we don’t need to bother about building that.

One nicety that comes with this approach is that we don’t need to worry about adding information to access our user’s…

Once you create a SwiftUI view, it has the default background color, white for light mode and black for dark mode respectively. How can you change it to something different? Let’s look into that today.

Photo by AB on Unsplash.

In this article, we will talk about different techniques that we can use to change the default background for our SwiftUI views.

Using modifier

The first approach that comes to mind is using .background() modifier. Sadly Apple hasn't provided documentation for this. It takes in a view that is set as a background for the view we are adding this modifier to.

In this case, we want…

Everything you need to know about sheets

Someone holding their phone
Someone holding their phone
Photo by Dries De Schepper on Unsplash.

When presenting a small piece of extra information on the screen, showing a modal view is essential. With UIKit, we could do this with presentViewController:animated:completion: function.

However, when using SwiftUI, we need to shift our thinking towards using view or environment state, as the modal view is now called a sheet.

Let’s check this out in detail.

Open Modal View (aka Sheet)

SwiftUI sheets help us show a modal view to users. sheet is an instance method to the View Presentation. It describes how we can show our SwiftUI views, covering specific user journey scenarios.

Let’s say we want to display information about our app…

Make a great first impression with a professional launch screen in your app

Phone on table
Phone on table
Photo by Martin Sanchez on Unsplash.

The launch screen is the first interaction that users see when using our apps. That’s why investing time in making our app launch screens feel responsive and visually appealing is important. We are playing with the “perceived time,” and it can make a great first impression.

At WWDC 2020, Apple introduced a new way to implement a launch screen for SwiftUI apps in iOS 14 using Xcode 12. When we create a new SwiftUI app, this is the new way to make launch screens. We can still use the old way with the Storyboard launch screen in our existing apps.

Launch Screen in Info.plist

Kristaps Grinbergs

Experienced Apple tech software engineer. Co-founded Qminder . Co-curator at swiftlybrief Love cycling and cats. Inclusivity. Vegan lifestyle. Animal freed

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store