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.


Localizing our applications is more critical than we think. We usually stick with English as the primary language. Only 4.9% of the world’s 7.8 billion inhabitants speak English. Most of the people aren’t native English speakers. In the grand scheme of things, only 360 million people speak English as their first language.

Photo by Amy Humphries on Unsplash.

SwiftUI gives us great and easy-to-use options to translate our applications into multiple languages. We might all be familiar with the Localizable.strings file where we put all the translations. I’m not going into how to create this for your projects.

In addition, Xcode has the option to change…


Grid layouts enable us to show views in a grid that expands either vertically or horizontally. For instance, we’ve all seen it in the iOS Photos application. Those who have worked with UIKit might recognize it as UICollectionView.

Photo by Michael Dziedzic on Unsplash.

SwiftUI offers two excellent options — LazyVGrid and LazyHGrid. This time, we will dig deeper and understand how we can use these components. The great thing about these two components is their usage; views are loaded lazily, which means when those appear on the screen.

I want to point out that HStack and VStack are available from iOS 14 and upward. If…


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.

Alert

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…

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