Swift & iOS

141 posts

Getting view size in SwiftUI without GeometryReader

We can avoid GeometryReader now! New modifier supports iOS 16+.

Swift & iOS

The weirdest Core Data crash I have seen

Careful how you name your attributes...

Swift & iOS

How to support tinted home screen widgets in iOS 18

Marking views to be rendered with colors, handling images and more.

Swift & iOS

My experience with the “Blinkist trial”: Big boost

Quite a lot higher trial start rate with lower conversion percentage.

Swift & iOS

SwiftUI

Fixing weird shadow animation glitch in SwiftUI

My “glow” animation started going wrong when switching tabs in a tab bar.

Swift & iOS

How to update widgets for StandBy mode

Short blog post about supporting StandBy mode introduced in iOS 17.

Swift & iOS

UX Diary

UX Diary: Onboarding without onboarding

About an approach I took in "GameWidgets" to better onboarding users into the app.

Swift & iOS

Hotfixing widgets for iOS 17: containerBackground + padding

How to fix the issue with background and extra padding.

Swift & iOS

Sharing data with UIActivityViewController - tips & tricks

All the tips and tricks I have discovered so far. Better previews, subtitles. PNG via AirDrop & more.

Swift & iOS

How to: Implementing “Shared with You” APIs

Short tutorial about adopting the Shared with You framework available in iOS 16.

Swift & iOS

The weirdest bug/crash in widgets?

Mysterious crash and ChatGPT to the rescue.

Swift & iOS

Implementing “double tap tab bar to scroll to top”

I got inspired by Ivory for Mastodon and implemented my solution in SwitchBuddy.

Swift & iOS

How to successfully launch app on Product Hunt: Balance by Alexander Sandberg

The story behind winning #1 Product of the Day and #3 Product of the Week.

Swift & iOS

SwiftUI

SwiftUI Tip: Always correct corner radius for subviews

Meet ContainerRelativeShape!

Swift & iOS

How to customize share sheet content for AirDrop

Or other share destinations, like adding to a reading list.

Swift & iOS

How to allow landscape for single screen in your UIKit app

Controlling device orientation without modifying the Info.plist or using “top view controller”.

Swift & iOS

How to combine Dynamic Type and monospaced font

This is a small tip for cases with countdown labels and similar UI.

Swift & iOS

The day my app got thousands of downloads and in-app unlocks

What happens when a quiet app gets almost a thousand new downloads, and in-app unlocks each hour?

Swift & iOS

Adding private analytics with TelemetryDeck: Quick Start

Quick look at how to add and use TelemetryDeck SDK to your Swift app.

Swift & iOS

Dynamic Island (and Live Activities): Quick start tutorial

All the steps you need to start creating your own Dynamic Island UIs!

Swift & iOS

App promotion

PSA: iOS 16 is a huge opportunity to promote your app

This may be obvious, but I still wanted to remind everyone.

Swift & iOS

App promotion

How to get featured on the App Store

According to devs who got features many times.

Swift & iOS

App promotion

Press Releases: Step-by-step guide

Detailed how-to about sending your first app press release.

Swift & iOS

App promotion

Does your app need a Press Kit?

Should you put the time into creating a Press Kit? And how much energy?

Swift & iOS

Compositional Layout

How to add swipe actions to Collection View

With the Compositional Layout list configuration this is fairly easy.

Swift & iOS

Compositional Layout

How to create a list with Compositional Layout

The easiest way for creating standard list layouts with the new APIs available from iOS 14.

Swift & iOS

Xcode: How to upload build with different Bundle ID to TestFlight

When you need to really separate development backend from production one.

Swift & iOS

WWDC 22

How to use UICalendarView in iOS

Look at setting up the proper calendar view with selections and customizations.

Swift & iOS

WWDC 22

How to use Live Text API in your iOS app

Quick start guide showing the newly available API in iOS 16.

Swift & iOS

WWDC 22

How to configure UIKit bottom sheet with custom size

With iOS 16, we can ask for any size we want!

Swift & iOS

How to resize image in Swift

While keeping the aspect ratio. Meaning the resize will be without stretching.

Swift & iOS

How to let user select file from Files

Quick look at the `UIDocumentPickerViewController` to access the Files app.

Swift & iOS

App promotion

Press Kit examples for inspiration

Here are a few examples of nicely done press kits that can also serve as a template.

Swift & iOS

Stuff to implement before you launch on App Store

A collection of small-ish things that can make a difference.

Swift & iOS

App promotion

Boost your Press Kit with lifestyle photos

Looking to increase chances of getting covered by the press? Shoot some real-life photos.

Swift & iOS

App promotion

Are Press Kits still relevant?

The short answer is yes. But it depends on your app and goals.

Swift & iOS

Customizing the navigation bar in UIKit

What worked for me and what didn’t.

Swift & iOS

Debugging files in iOS

A couple of tips on verifying that your files and folder operations do what you expect.

Swift & iOS

App promotion

Lessons from reviewing 10+ press kits

Here is what I learned and recommend after reviewing bunch of press kits.

Swift & iOS

App promotion

5 tips for reaching out to press

While there are no guarantees, choosing the right strategy will significantly improve your odds.

Swift & iOS

Open your app's Documents folder programmatically in Files app

There is a scheme to launch the iOS Files app inside your app directory quickly.

Swift & iOS

Gradient borders in UIKit

Short post on applying gradient to borders without too much hassle.

Swift & iOS

Always correct gradient text in UIKit

Applying gradient colors to UILabel text isn't straightforward. Let's see how to do it.

Swift & iOS

Creating patterns with UIColor. Yes, really

Short post about fun usage of UIImage inside of UIColor.

Swift & iOS

Compositional Layout

How to show page indicator with Compositional Layout

Short guide how to do it with UIPageControl and Combine. Full source code available.

Swift & iOS

App promotion

8 "marketing" ideas for your app

Ideas to get you started when you want to "do marketing" for your app.

Swift & iOS

Quickly preview app icon on a real device

Introducing small new tool called App Icon Preview.

Swift & iOS

Diffable

Fixing wrong animations with Diffable Data Source

The most common causes and how to fix it.

Swift & iOS

App promotion

Careful when getting inspiration from popular apps

On the pitfalls of mistaking correlation with causation.

Swift & iOS

App promotion

Minimal Press Kit your app should have

Assuming you plan to contact the press.

Swift & iOS

Make rounding specific corners easier with extension

Renaming constants goes a long way...

Swift & iOS

App promotion

What is a Press Release? Should you care as a developer?

Why bother? And how to get started without getting overwhelmed.

Swift & iOS

App promotion

5 tips for better App Store screenshots

Whether you are preparing to publish your first app or want to improve screenshots for already published one, I hope at least some of these tips will be helpful.

Swift & iOS

App promotion

4 reasons why ZIP file Press Kit isn't an ideal solution

You may be losing press coverage because of this.

Swift & iOS

App promotion

Where to promote your app for free?

Without hoping that some journalist will write about it.

Swift & iOS

How to disable automatic transparent tabBar in iOS 15

With Xcode 13 and the iOS 15 SDK there are important changes to UITabBar.

Swift & iOS

How to disable automatic transparent navbar in iOS 15

Xcode 13 along with iOS 15 SDK brings substantial changes to UINavigationBar.

Swift & iOS

Loading HTML text into UITextView

Using NSAttributedString. With pitfalls to avoid.

Swift & iOS

How to check if Mobile (Cellular) Data is enabled for your app

Another niche topic, that may be quite useful in certain situations.

Swift & iOS

Implementing drag & drop for Collection View

A quick loot at implementing drag and drop capabilities in your app using Collection View.

Swift & iOS

Implementing alternate icons in iOS

Overview of what you need to do to allow users to select custom icons. With common pitfalls and iPad implementation.

Swift & iOS

WWDC 21

WKWebView improvements in iOS 15

Media playback APIs, theme color, async support, downloads and more.

Swift & iOS

WWDC 21

SFSafariViewController improvements in iOS 15

There's an option to run custom extension on the page content and also preload some content.

Swift & iOS

WWDC 21

Core Location UI: New way to get one-time location

Apple has new solution for apps which need location only sometimes.

Swift & iOS

WWDC 21

Meet the new bottom sheet in iOS 15

We can finally use the modal sheet that does not take up the entire screen on an iPhone. And it is just a bit of configuration.

Swift & iOS

WWDC 21

Big improvements to UIButton in iOS 15

Predefined styles. Trailing images! Loading style and much more.

Swift & iOS

WWDC 21

New approach to formatters in iOS 15

There are huge foundation news regarding formatters. They were basically moved behind the scenes.

Swift & iOS

Checking if device is locked (or sleeping) in iOS

This is easier in the main app, but there is a way to do this in the extension as well.

Swift & iOS

AppStories

Solving difficult problem by solving way easier one

First post in new experimental article format.

Swift & iOS

Connecting to Wi-Fi programmatically in iOS with Swift

With a little bit of code, you can prompt the user to connect to Wi-Fi network of your choice.

Swift & iOS

How to save image into Photos

Without that crazy Objective-C method that requires selector.

Swift & iOS

Creating basic configurable Siri Shortcut

Simplest possible tutorial to get you started with Siri Intents.

Swift & iOS

Codable

How to decode dates with Codable

In this post we will look at strategies you can use to decode dates. Custom decoder isn't needed.

Swift & iOS

Backend for Swift developers workshop [info]

Custom backend for your apps is not exactly rocket science and can give you a big boost.

Swift & iOS

Core Data

How to save enum to Core Data

With a bit of help of computed property, we can save enumerations into Core Data quite easily!

Swift & iOS

WKWebView

JavaScript basics for iOS developers

What you need to know to manipulate content in WKWebView, how to make Swift & JavaScript talk to each other, how to call JavaScript functions and more.

Swift & iOS

Codable

How to decode snake case with Codable

Forget CodingKeys. There is much better solution available!

Swift & iOS

Randomness in Swift: Comprehensive overview

Random numbers, random array elements, random color, fair randomness and more.

Swift & iOS

UIMenu: Comprehensive guide

Learn how to use UIMenu to build modern UI. This tutorial shows basic example, how to add separator, how to work with submenus and more.

Swift & iOS

Compositional Layout

Re-creating Apple Photos layout & animations with Compositional Layout

Let's see how we can create layout similar to the native Photos app in iOS. Complete with the transitions.

Swift & iOS

How to show UIMenu from UIButton or UIBarButtonItem

Learn how to display context / popup menu from UIBarButtonItem and UIButton with this guide.

Swift & iOS

Compositional Layout

How to create responsive Compositional Layout

Let's look at basic example tutorial about creating Compositional Layout that adapts to available screen space.

Swift & iOS

Compositional Layout

How to create sticky headers with Compositional Layout

It is actually quite easy, but you need to know where to activate this behavior. Let's see how to enable pinned headers.

Swift & iOS

Compositional Layout

Useful extensions for CollectionView and Compositional Layout

With a few extensions, you can make working with CollectionViews and Compositional Layout a lot cleaner.

Swift & iOS

Compositional Layout

How to create onboarding with Compositional Layout

Utilizing Compositional Layout to create onboarding flow. Full code example is available.

Swift & iOS

How to use NSDataDetector to detect links, email addresses, phone numbers and more

And also a look on creating prettier API with the help of extensions and enums.

Swift & iOS

Compositional Layout

How to create grid with Compositional Layout

Let's look at creating basic grid layouts using Compositional Layout.

Swift & iOS

What is intrinsic content size and why care?

In this post I would like to touch a bit on a less known part of UIKit layout. The what and why of intrinsic content size.

Swift & iOS

Compositional Layout

Example project showing Compositional Layout and Diffable

Check out my GitHub project for hand-on examples showcasing how to build various layouts using modern APIs.

Swift & iOS

Compositional Layout

Building Instagram profile screen with Compositional Layout

Let's build the profile page with avatar, followers count, highlights and photos.

Swift & iOS

Compositional Layout

Using background decoration views with Compositional Layout

These can help you add a bit of visual flair or maybe imitate the inset table view style.

Swift & iOS

Diffable

Tips and practices for setting up Diffable Data Sources

In this post I would like to show a few approaches that make working with Diffable cleaner and better.

Swift & iOS

Compositional Layout

Supplementary views with Compositional Layout and Diffable Data Source

In this post we will see how to add badges to CollectionView. You will learn how to add supplementary views, configure them and display them.

Swift & iOS

Compositional Layout

Detailed look at the NSCollectionLayoutGroup

With the NSCollectionLayoutGroup definition we can create quite different layouts while keeping the rest of the code the same.

Swift & iOS

Contacts

How to let user select contact from their contact list

A short look at the CNContactPickerViewController from the ContactsUI framework. Learn how to leverage this contact picker to access contact details.

Swift & iOS

EventKit

How to monitor system calendar for changes with EventKit

If you are working with either calendar events or reminders via EventKit framework, you need keep the data up-to-date with the system calendar database.

Swift & iOS

Diffable

How to refresh header / footer with Diffable Data Source

All that is needed is correctly configured section with associated value. Learn how to properly refresh supplementary views with Diffable Data Source.

Swift & iOS

iOS 14: How to send email using default email app

Letting your users send you feedback just got significantly easier with iOS 14. Let's see how.

Swift & iOS

Diffable

Implementing loading / shimmer with Diffable Data Source

Quick look on one way how to implement loading state for your collection view or table view when using diffable.

Swift & iOS

Core Data

Demystifying Core Data: A guide for newcomers

This post is intended for newcomers to the development on Apple platforms. Since Core Data will undoubtedly feel daunting for a lot of new developers, I decided to try to explain it in simpler terms.

Swift & iOS

Making files from your app available in the iOS Files app

Learn how and why you can make your app's Documents folder accessible via Files app in iOS. And also how to write files into the Application Support directory.

Swift & iOS

Compositional Layout

Basic anatomy of collection view compositional layout

Understanding the basic building blocks of the great compositional layout for collection views.

Swift & iOS

Porting iPhone app to iPad: My experience

Tips and approaches to use when you don't have the time to build iPad version from scratch.

Swift & iOS

Implementing multi-user support in tvOS 14

Turns out it is pretty easy change to make with potential benefits for your users.

Swift & iOS

Refactoring UIAlertController: Helper class and protocol approaches

Detailed look at two possible approaches to avoid writing boiler plate code over and over.

Swift & iOS

How to approach complex programming problems

Some tips and approaches how to tackle difficult problems. Including examples from my Chill Zones app.

Swift & iOS

EventKit

How to create new calendar using EventKit in Swift

Apart from reminders and events, EventKit framework also gives you the power to create new calendars for users. Learn how.

Swift & iOS

Core Data

Minimal example of using Diffable Data Source with Core Data

The new Diffable Data Source is totally different way to setup Table Views and Collection Views. This example will get you started.

Swift & iOS

Core Data

How to create Core Data database from multiple model files

This is useful if you want to split your app into modules but still keep and manage only single database inside the main target.

Swift & iOS

Core Data

My approach to setting up Core Data stack

This post details how I set up Core Data in my projects and also explains what and why. It includes working with background context.

Swift & iOS

EventKit

How to use EKEventEditViewController in SwiftUI

My finished solution to bridging this view controller for creating new events and editing existing ones to SwiftUI.

Swift & iOS

EventKit

How to use EKCalendarChooser with SwiftUI

Short post showing how to bridge this controller with SwiftUI and get selected calendars.

Swift & iOS

How to implement OCR in iOS without 3rd party frameworks

Learn the basics of getting OCR up and running plus a few tips and extra stuff you may want to know.

Swift & iOS

EventKit

How to create iOS reminders programatically with alarms or recurrences

Learn how you can create reminders that will show in the Reminders app. With alarms and recurrences.

Swift & iOS

WWDC 2020

iOS 14: Quick dive into the new UIColorWell

This looks like an ideal solution if you want to let user pick multiple colors.

Swift & iOS

WKWebView

iOS 14: What is new for WKWebView

JavaScript sandboxing. Support for JavaScript promises, find on page, zoom and more!

Swift & iOS

CloudKit

How to setup CloudKit subscription to get notified for changes

CloudKit subscription offers best way to keep data up-to-date for your user. I will show you the simplest setup to get started in this cloudkit subscriptions tutorial.

Swift & iOS

WWDC 2020

How to let user select photos from iOS Photo Library

Much better experience. No permissions required and multi-select!

Swift & iOS

WWDC 2020

Look at the new UIColorPickerViewController in iOS 14

Learn how to use the iOS color picker which also features palette of colors and sliders. There is also limited customization.

Swift & iOS

EventKit

How to save event into user's calendar

In this post we will use the EventKit framework to save event to default calendar.

Swift & iOS

How to scan documents in under 10 lines of code

Thanks to VisionKit framework scanning documents is very easy with iOS 13 and up. In this blog post I will show you how.

Swift & iOS

EventKit

How to load events from user's calendar

In this post let's go over how to load events that user has in their system calendar. Learn about permissions, requesting access and load the events.

Swift & iOS

How to get file size using FileManager + formatting

Learn how to get file size URL and also how to format it to human-readable string by special formatter.

Swift & iOS

Improve your UIKit layouts with these tips & tricks

A collection of tips that I found very helpful when building UI and why to avoid Table View Controller.

Swift & iOS

iOS 13: launchOptions always nil? This is the reason & solution

launchOptions have moved and you find them in AppDelegate no longer.

Swift & iOS

WKWebView

Using WKWebView in headless mode

This is another short post about using `WKWebView`. Yet another useful use case can be to run `WKWebView` in the background, meaning user does not see it on the screen.

Swift & iOS

How to quickly remove duplicates from Array & keep order

Removing duplicates (objects, characters, ..) is swift in Swift thanks to the Set type. We can also leverage NSOrderedSet to not lose order of the items.

Swift & iOS

How to add badge to UIBarButtonItem

Badges on UIBarButtonItem are not natively supported but we can fix that with custom UILabel.

Swift & iOS

EventKit

How to use EKCalendarChooser in Swift to let user select calendar in iOS

Learn about working with EventKitUI to let user select their calendars with the calendar picker. Permissions and delegate explained.

Swift & iOS

How to let users send feedback using email app of their choice in iOS

Don't force your users to use Apple Mail. Offer them Outlook, Gmail or Spark.

Swift & iOS

How to create reusable UIView with .XIB file for easy design

Create cleaner project by leveraging reusable views with design done in .XIB files.

Swift & iOS

How to display files like PDFs, documents, GIFs, images and more in your app

Short guide demonstrating how to use QLPreviewController for easy file previews. It even supports ARKit models!

Swift & iOS

How to generate image previews / thumbnails of various files

Creating previews for files is breeze thanks to Quick Look framework. This quick guide will get you started.

Swift & iOS

Advanced string comparison and sorting in Swift

Going beyond standard contains and hasPrefix methods. Learn locale-aware sorting and how to ignore diacritics.

Swift & iOS

Few book recommendations that will make you a better developer

I have selected a few books from many I have read and wrote up why I think these are great choices for iOS developers.

Swift & iOS

How to temporarily cover whole screen of your application

Learn to hide sensitive information when the app is visible in the app switcher or just prepare something cool for the users.

Swift & iOS

CloudKit

Saving files into user’s iCloud Drive using FileManager

This is an example of accessing iCloud Drive and saving files there. Learn how to save files with my guide in iOS.

Swift & iOS

How to implement swipe to delete action with custom icon in TableView

Learn how to use trash icon (or any other image) instead of the standard "Delete" text.

Swift & iOS

EventKit

How to use EKEventEditViewController in Swift to let user save event to iOS calendar

Short example showcasing the usage of EKEventEditViewController to let user edit and add events to iOS calendar.

Swift & iOS

Four tips to level up your Swift

How to unwrap optionals in a loop. Utilize @autoclosures, cleaner range checking and easy randomness.

Swift & iOS

WKWebView

How to open target="_blank" links in WKWebView in iOS

Short post explaining why by default target _blank links don't do anything and how to fix it with example code.

Swift & iOS