Up to iOS 12 the AppDelegate would deal with process level events informing when the application launched and terminated and letting you know the state of its UI with UI lifecycle methods like did enter background or foreground events. This made the AppDelegate the perfect place for developers to configure the UIWindow container to programmatically launch the entry point of the application. This was fine in a world of single window applications…

From iOS 13 and onwards though we now have the concept of multi-window session capabilities allowing you to have multiple app instances running at the same time with…


I came across a bug where Voice Over was not announcing elements in the way we wanted. I had an overlapping view which could be presented dynamically and when presented we wanted the sibling views’ elements not to be announced.

This is what the hierarchy looked like:

ComponentContainerView subviews [
ViewA,
RefreshView // This view is added and removed.
]

The RefreshView is a dynamic view that overlaps ViewA completely when presented. Here is an example on how a view can be added modally and removed:

By default Voice Over will traverse through the hierarchy and announce the view…


We explore sets, union and intersection, and testing

An image that reads Day 6: Customs Customs Advent of Code in Swift

The Advent of Code is an Advent calendar consisting of 50 small programming puzzles released every year on December divided over 25 days through to Christmas.

Day 6: Customs Customs challenge

We’re now on Day 6! Well done if you’ve made it this far. In this article we explore how to solve the Customs Customs challenge.

Step 1/4: Understand the premise

You’re told you’re on an aeroplane approaching your destination and passengers are answering a customs declaration form with yes or no questions. You need to tally whoever answered yes to the questions.

Note: Since you have to tally whoever answered you’ll want to start thinking about higher order functions


How to complete all 25 day challenges in Swift. The quick and elaborate ways.

Day 1. Advent of Code in Swift

The Advent of Code is an Advent calendar consisting of 50 small programming puzzles released every year on December divided over 25 days through to Christmas.

You can complete the challenges in any language aimed to test a variety of skill sets and skill levels. Developers all around the world participate using it as an opportunity for interview prep; to practise new problems; explore new programming languages; or to simply challenge each other.

We promise ourselves as developers that this will be the year we follow through to complete every daily challenge only to fail just like breaking yet another…


Live coding interview tests can be daunting but are there to test a developer’s ability to solve certain problems. If you can present yourself well you often don’t even have to complete the test to pass the interview round.

The dreaded Interview Scenario

You’ve just hung up the phone with your recruiter who has made you aware you have passed your first round phone conversation and are asked to come in tomorrow for a live coding test. You try to get clues on what the test may be about and you get told to refresh yourself on UIKit and to bring your a-game. …


A strange yet quick way to unwrap optionals and operate on them.

How do you optionally (pun intended) operate on an optional if a value is present? Today we explore how.

Shows a user-input interface containing a number keypad with cells in a tableview displaying number values
Shows a user-input interface containing a number keypad with cells in a tableview displaying number values

Above is a screen for an application which takes in optional string inputs and stores them in the form of an optional number in the cell model. The method for processing a String? into an Int? may look something like this using the if let syntax:

It looks messy, and we can do better. A quicker way of doing this is to use the flatMap method.

flatMap

This term usually floats around in the topic of Higher-Order Functions — the method…

Pavan Kataria

Engineer Pavan, First of His name, the Unburnt, Lord of the iOS Realm, Bug Breaker, Space Indenter, and New writer — otherwise known as PK

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