Removing duplicates to get unique values out of an array can be a common task to perform. Languages like Ruby have built-in methods like uniq but in Swift, we have to create such methods on our own. The standard library does not provide an easy method to do this. There’s a lot of ways to …
Billing Grace Period Explained: How It Works and Why It Matters
Users with auto-renewable subscriptions can enter a billing grace period if their automatic payment failed. In this period, they can continue their premium access to your app, while Apple will do its best to help the user fix their payment issues. While it sounds like common sense and a great feature, I discovered it’s not …
Institutional Purchases: Understanding and Detecting
A download spike caused by Institutional purchases visible in App Store Connect causes confusion to many app developers. Several posts on Reddit or Apple’s forums try to answer what they are, but there’s still a lot of confusion about them. Apple’s Volume Purchase Program (VPP) relates and results in a different behavior for your app. …
Universal Links implementation on iOS
Universal Links allow you to link to content inside your app when a user opens a particular URL. Webpages will open in the app browser by default, but you can configure specific paths to open in your app if the user has it installed. This behavior is well known as “deeplinking” into your app. Redirecting …
Testing push notifications on the iOS simulator
Testing push notifications in the iOS simulator makes adding support for remote notifications much more effortless. However, you often must iterate a lot to verify that your code is working as expected. After gaining permission to receive push notifications in your app, you can start testing out several notifications. Xcode’s Simulator supports testing both regular …
SwiftUI ForEach Explained with Code Examples
If you’re building dynamic lists or repeating UI components in SwiftUI, there’s a high chance you’re already using the SwiftUI ForEach view element. It’s a powerful, yet sometimes misunderstood, view element in SwiftUI. This article will help you understand how ForEach works and when and how to use it. We’ll also dive into index-based iteration and how …
Swift 6.2: A first look at how it’s changing Concurrency
Swift 6.2 is the upcoming release of Apple’s native language. It’s currently in active development, and as you know from my weekly Swift Evolution updates, many proposals are currently being processed. While many of you usually await a new Xcode release before jumping into new changes, I think knowing what’s coming up is essential this …
Swift Reduce: Combining elements into a single value
The Swift reduce method allows you to produce a single value from a collection of items. You can use it to convert an array into a dictionary or another common example is to reduce numbers and sum them up. This introduction should pique your interest in swift reduce. Reduce is a typical functional pattern, a …
SwiftUI Alert Guide + Code Examples
You can present a SwiftUI Alert using dedicated view modifiers that make it straightforward to present native alerts. It works a bit differently compared to their UIKit variant, but you’ll get used to them quickly. In this article, we’re going to dive into the SwiftUI Alert functions and I’ll demonstrate a convenient way of presenting …
SwiftUI Grid, LazyVGrid, LazyHGrid Explained with Code Examples
SwiftUI Grid, LazyVGrid, and LazyHGrid are UI elements that allow you to place views in a structured grid. You can control the horizontal and vertical spacing, columns, and rows. You typically use the lazy variants for performance improvements since they load items lazily when they need to enter the screen after scrolling. A SwiftUI Gridview …