Swift & iOS

80 posts

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

Checking out the new PHPickerViewController in iOS 14

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