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!

Websites

Apple


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:

  • Starting a run.
  • Tracking the user’s location.
  • Displaying live stats about the run.
  • Sharing the user’s performance.

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…


TOOLING

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. …


Don’t reinvent the wheel — your problems have already been solved

Apple Iphone sitting on a Macbook computer.
Apple Iphone sitting on a Macbook computer.
Photo by Samuel Souza on Unsplash

One of the first principles of engineering is to not reinvent the wheel. When working on a project, everybody builds on top of code written by someone else.

At the very basic level, we all use the frameworks provided by Apple: Foundation, UIKit, StoreKit, and so on.

On top of that, every app has a layer of common problems with the other apps. Well-known problems are solved by libraries that are used by thousands of developers. This has contributed to making those libraries a robust, tested, and reliable piece of software. …


Speed up your daily coding routine

MacBook glowing in the dark
MacBook glowing in the dark
Photo by Wesson Wang on Unsplash.

As a software engineer, I spend most of my day typing on a keyboard. As an iOS developer, the IDE that I use every day is Xcode. Through my experience as a developer, I have learned a few shortcuts that help me work faster and prevent me from moving my hands away from the keyboard.

Today, I want to share them with you. I would be delighted if you can benefit from at least one of them.

1. Open Navigators Quickly

One of the most visible panels in Xcode is the Navigator panel. This is the leftmost panel, and it shows different information based…


Add dependencies and custom modules to personalize your iOS project

Person skateboarding
Person skateboarding
Photo by Drew Hays on Unsplash.

This is the second part of a series about configuring a project with Tuist. Check out the first part if you haven’t already.

Tuist is an amazing tool to programmatically create an Xcode project and an xcworkspace. The project is defined using Swift and described by reusable functions and types.

Last week, we explored the default configurations created by Tuist. We saw how Tuist prepares the app target with two supporting modules: one for the UI and one for the logic.

Sooner or later, we would need to add other dependencies to our project. How can we accomplish that? …


How to automatically generate a .xcodeproj file from a Swift file

Apple laptop and phone
Apple laptop and phone
Photo by freestocks on Unsplash.

When the number of engineers on a team starts to increase, they should use a version control system (VCS) to share their code. One of the most famous and used is Git. GitHub and GitLab are services we leverage every day.

Git and its siblings are great for storing and sharing code with colleagues. They offer many features like file diffing, blame, revert, and so on. When two or more people work on the same files, those files are modified at the same time. Sooner or later, one of the two developers will have to merge their colleague’s changes with…

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