Small suggestions to make the life of your reviewer easier

Photo by Markus Winkler on Unsplash.

Creating a PR and waiting for a code review is a standard approach to writing code. PRs and code reviews are very important in every developer’s day. They achieve different goals:

The process is usually split into two steps: A developer prepares a PR and another developer (or several) performs a code review, pointing out the good parts and the parts that can be improved.

Today, I’d like to go through the first step, highlighting how we can create a PR…

How to use concurrentPerform to write parallel code with ease

Photo by Nathana Rebouças on Unsplash.

If you follow my blog, you’ll know that I love concurrent programming. I’m very fascinated by the idea of running different tasks at the same time, collecting the results, and saving a ton of time.

This week, while working on my team's current project, I discovered a new API that I was not aware of: DispatchQueue.concurrentPerform. This small and nice API lets us run batches of work together and will handle all the concurrency for us.

Let’s explore it together.

concurrentPerform in Theory

When working with a new API, the first thing to do is to read its documentation:

“This method implements an…

Use the Containment API to create a TabBar we fully control

Open workspace
Open workspace
Photo by Leon on Unsplash.

SwiftUI is becoming more mature every day, but UIKit is here to stay. This is something that already happened in the past with other technologies. Swift, for example, was released in 2014, but there are many apps out there that are still written and maintained in Objective-C.

UIKit offers several components to build our apps, but sometimes their APIs are not as flexible as we would like. Sometimes those components work weirdly and we struggle to change their behavior. Have you ever tried to implement a custom animation for a UITabBarButton, for example?

In today’s article, I’d like to share…

Swift tricks to improve our code writing skills

A laptop
A laptop
Photo by Maxwell Nelson on Unsplash

A good software engineer is not just a person who can solve problems efficiently writing software. They are people who can write code that is robust, easy to read, and easy to maintain more than writing smart one-line solutions.

Good software engineers spot where they can simplify the code, use patterns, or refactor pieces of code to make them better.

Let’s explore five of my favorites ways to write cleaner and more meaningful code in Swift.

Use Positive Guards

The guard keyword is one of the most defining of the Swift programming language. …

Handle complex flows with OperationQueue

Japanese shrine
Japanese shrine
Photo by JuniperPhoton on Unsplash.

Concurrency and asynchronicity are two big topics in any app. We use asynchronous code every day for network requests and other operations, and we need to master it.

Concurrent programming is a more hidden topic, but it can pop up in any app as well. What if we develop an image-processing app and we want to apply different filters to different images at the same time to create a collage? With concurrent development, we don’t have to wait for all the filtering to complete sequentially. If we apply all the filters at the same time, we can wait only for…

Remove code smells from your code base

iMac on desk
iMac on desk
Photo by Norbert Levajsics on Unsplash.

After releasing a project, we want to add new features, A/B test some other features, and remove old features that no longer make sense.

All these interventions belong to the evolution process of a project. They fall in the adaptive maintenance and perfective maintenance categories. In some other cases, we need to intervene to fix a bug that is affecting our users. This intervention belongs to the corrective maintenance sphere.

What do all these changes have in common? They are all maintenance interventions that change the code base. …

How to stay updated on our favorite platform

a closed Apple device showing the Apple log
a closed Apple device showing the Apple log
Photo by Masaaki Komori on Unsplash

Learning is a constant in any software engineering career. New technologies arise every day, and our chosen platform is periodically updated. If we want to stay in the game, we need to invest time in reading, studying, and improving our knowledge constantly.

Today I’d like to go through the main channels I use to stay updated on the iOS world, to keep my game at the highest level possible.

I’m sure that you already know most of them, but perhaps you can find some hidden gem!



Let’s add new features to the foundation types

Image of male developer.
Image of male developer.
Photo by Annie Spratt on Unsplash

Many of us have studied algorithms at university or college. Not many of us have actually implemented any of those algorithms.

The standard library (or Foundation for Swift) offers ready-made methods and functions that implement those algorithms. Very few of us have ever implemented a quicksort, but we use methods like invoked the sort daily.

Not all the algorithms we studied are available in the Foundation framework. Today, I’d like to implement one of those algorithms with you, and I want to show you how to add it to every collection in a single shot. …

Choose the right storage based on your requirements

Laptop on desk
Laptop on desk
Photo by Alex Cheung on Unsplash.

When thinking about the features of a running app, the main ones we would consider are:

These are all key functionalities that make a good running app, and they fall under the functional requirement category:

“In software engineering and systems engineering, a functional requirement defines a function of a system or its component, where a function is described as a specification of behavior between outputs and inputs.” — Wikipedia

These requirements rely on other capabilities to work properly. For example, to share the…


Improve your iOS code quality with these small tools

Photo by Pineapple Supply Co. on Unsplash

When the size of a team grows, it’s just natural that we establish some common practice to maintain a bit of sanity while working. These practices prevent Git conflicts, create a more homogeneous code base, and help people feel comfortable with the code written by their colleagues.

In some cases, these practices could be hard to enforce formally and automatically. For example, whether to use a Protocol or a ProtocolWitness can’t be enforced formally — it’s more of a coding style. There are many other cases where that’s possible. …

Riccardo Cipolleschi

Hi everybody, I’m Riccardo. Senior iOS Engineer at Bending Spoons, I breathe iOS development: apps and tools. I love to share my knowledge with others.

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