Sign in

Senior iOS Engineer @ Onfido. Writing weekly blogs on iOS and programming. Follow me to stay tuned!

Computer Vision

Photo by Albert Hu on Unsplash

Are you looking to make your physical business contactless? COVID-19 has transformed how business with physical presence need to interact with their customers. Many customers now expect the ability to perform transaction on their mobile devices. Restaurants in the UK only allow to view their menu through your mobile phone by scanning a QR code. Some even allow you to pay the bill be scanning the QR code on your table through their app. QR codes were already rising in popularity however now they have become the standard for businesses to interact with customers and augment their experience.

In this…

Swift Programming

Observing and getting notified when properties changes

Photo by Erik Mclean on Unsplash

KVO and KVC or Key-Value Observing and Key-Value Coding are mechanisms originally built and provided by Objective-C that allows us to locate and interact with the underlying properties of a class that inherits NSObject at runtime. In short this mean that you can interact with a property through a stringly typed key instead of your usual dot syntax which is checked at compile time.

In this post I will explain how to use KVC and KVO through an example that will further explain the terms. …


Learn how to modularise a SwiftUI based framework for iOS

Photo by Tekton on Unsplash

This is an update to my original post Reusing code with Swift frameworks. The original post showed how to reuse UIKit based code packaged as a framework. Since then Apple has introduced SwiftUI and this post will show you how to reuse your SwiftUI code.

SwiftUI has brought a natively supported declarative way of building UI’s. Furthermore SwiftUI and Xcode encourage you to build small components which can easily be reused. But what if you want to use the same components across multiple projects?

You might want to build another product for your company and make the app have the…


Learn how to create and manage UIScrollView and its content programmatically

Photo by Taylor Wilcox on Unsplash

Storyboards and Interface Builder(IB) are great when you start a new UIKit based iOS project. However they can soon loose their appeal as you develop more complex screens, UIs and user flows.

Alternatively you can start develop your UI programmatically. However developing and managing UIScrollView’s programmatically can be tricky and easy to forget how to.

In this tutorial I’ll show you how to create a UIScrollView and manage its content programmatically. We’ll be starting off from an existing iOS app project.

In the app we’ll be displaying the recipe on how to make Paella using UILabels, UIStackViews and UIImages. The…

Swift Programming

Learn how to do Dependency Injection using Swift Property Wrappers

Photo by Diana Polekhina on Unsplash

This article is about how to do Dependency Injection in Swift using Property Wrappers. I assume you are familiar with Dependency Injection and Swift Property Wrappers. Furthermore you should be familiar with the basics of Swift and iOS development.

But before I show you how to do dependency injection using Swift Property Wrappers let’s quickly recap on dependency injection:

What is dependency injection? Dependency Injection is a form of Inversion of Control that moves the responsibility of assembling objects to a container.

Why use dependency injection? Amongst other things it allows you to:

  • Extract dependency assembling responsibility to a container

Swift Programming

Learn what property wrappers are and how to use them

Photo by Ronise daluz on Unsplash

What is a property wrapper in Swift?

A property wrapper adds a layer of separation between code that manages how a property is stored and the code that defines a property.

In all honesty when I read this bit from’s documentation I did not quite understand what property wrappers are. So again what is a property wrapper in Swift?

Before I explain Swift Property Wrappers let’s briefly recap two other Swift features:

  1. lazy loading properties
  2. optionals

I assume you are familiar with these already. …


Learn how to perform multiple task concurrently in iOS

Photo by Braden Collum on Unsplash

How do you execute multiple pieces of code at the same time? When beginning coding we are taught code that executes serially or one after the other in order.

Let’s look at an example. Let’s say you’re making a simple salad. Here are the ingredients:

  • lettuce
  • tomatoes
  • red onion
  • sweetcorn
  • tuna with sunflower oil

The process is simple: cut what needs cutting and mix it all.


This simple salad does not has a specific order in which to add the ingredients. …

Computer Vision

Everything you need to get up and running to develop and debug an OpenCV C++ algorithm

Looking to solve Computer Vision problems using OpenCV? Maybe you are developing an OpenCV algorithm to be used on multiple platforms like iOS and Android.

A great way to develop cross-platform OpenCV algorithms is by writing them in C++ and using Xcode. Both platforms support running and binding to C++ code. However developing an OpenCV algorithm inside §By testing your OpenCV C++ algorithm on your Mac you can save time and effort when developing the algorithm.

The aim of this post is to help you get up and running developing and debugging an OpenCV C++ algorithms. …


Does the word cryptography sound cryptic? Read on to learn about cryptography and remove the mystery

Photo by Georg Bommeli on Unsplash

The word Cryptography is derived from the Greek words Kryptos and Graphy. Kryptos means hidden and Graphy means writing. Thus Cryptography means hidden writing.


the science or study of the techniques of secret writing, especially code and cipher systems, methods, and the like

This post is an introduction to cryptography. The aim of this post is for all audiences to understand what Cryptography is. We will first look into the origins of Cryptography. Then we will cover Cryptography terminology. Finally I will explain how modern Cryptography works.

You don’t need any skills to consume this post.

The origins

The first…


Design patterns are great tools to solve reoccurring problems in software design. They are blueprints of solutions you can apply.

One of the most important design patterns on iOS is the delegate pattern. It is the design pattern most commonly used in many Apple frameworks and libraries. Being familiar with this pattern will:

  • Add a tool to solve reoccurring software problems in your code
  • Quickly navigate and use Apple APIs

Additionally to the above other iOS developers are likely to be familiar with this pattern and thus easily get acquainted with your code.

In this post I will help you…

Anurag Ajwani

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