Image for post
Image for post

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.


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.

Image for post
Image for post
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 photo library in Info.plist file. Users can decide to allow access either to all photo library or selectively grant access to particular photos. …


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.

Image for post
Image for post
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 to change the background color. For instance, we can pass in Color.gray. …


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 to users. …


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

All the setup is done in the Info.plist file. We can see that there is an empty Launch Screen key with the Dictionary type. …


Add a new font to your iOS app today

Hand holding out phone
Hand holding out phone
Photo by NeONBRAND on Unsplash.

A while back, we looked into Dynamic Type with the system font. This time, we are going to check out how to use Dynamic Type with a custom font in our iOS apps. Apple provides great APIs to make our apps accessible — even if we’re using custom font styles.

Add Custom Font to App

First, we need to add our custom font to the project. There are several steps involved, so let’s go over them.

We need to add a font file to the Xcode app project. Currently, True Type Font (.ttf) and Open Type Font (.otf) files are being supported. Just drag and drop files in your XCode project. …


Image for post
Image for post

Finding places, navigating our way, or simply checking what’s around — these are essential things that smartphones can help with. This year Apple added maps functionality to the SwiftUI framework. Let’s check out how we can use it and what are the current problems.


Image for post
Image for post

Every year the third Thursday of May is the Global Accessibility Awareness Day (GAAD). This time I want to focus on Dynamic Type in our iOS, iPadOS, and macOS projects. By implementing font scaling we can improve lives for loads of people with disabilities and impairments.


Image for post
Image for post

Swift on the server lately is getting more traction despite IBM leaving the club. One of the most popular frameworks out there is Vapor. It is built on top of Apple’s SwiftNIO and written fully in Swift programming language.


Image for post
Image for post
Kudos to drawkit.io

NSTimer or just Timer in Swift world is a commonly used way to execute something repeatedly with an interval. For instance, a countdown timer is a perfect example.

About

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