Primitive types hide important details of the domain

Image for post
Image for post
Photo by Lauren Richmond on Unsplash.

Hello and welcome!

Today, I will talk about why you should avoid using primitive types in your code.

A primitive type is a basic type that a programming language provides. Examples of primitive types include Int, String, Dictionary, and Array. These are the basic types that we use every day.

So I Shouldn't Use Primitive Types?

Don’t get me wrong. Primitive types are not bad per se. They are the basic building blocks that we have to create a computer program. We need them.

But we tend to abuse primitive types — especially in our domain objects. …

An extensible button using composition

Hello and welcome!

Today I will explain in detail how we implemented the 3D buttons used in the Trivia Crack app on iOS.

Looking for the complete implementation? Here it is!

The Buttons

This is a typical button that you can find in the Trivia Crack app:

Image for post
Image for post

But this is not the only one. We have different buttons used to show some information, to close a screen, to see a video and obtain a reward, and so on.

Image for post
Image for post

Let’s see how we implemented those buttons.


We need to start somewhere. That somewhere is the button itself. The class is named Button3D and is the base class for this type of buttons (we will talk about subclasses later). …

Build clean, organized and maintainable apps

Image for post
Image for post
Photo by Philip Swinburn on Unsplash

At the beginning of my career, I didn’t follow any real methodology to create iOS applications. I was great at coding massive view controllers and creating big balls of mud.

But about two years ago I started working with Interaction-Driven Design at my company. And It changed the way that I build software. It will change it for you too.

What is IDD?

Sandro Mancuso introduces Interaction-Driven Design in this post. The following definition is taken from there:

IDD is an iterative approach to software design and development based on Outside-In Development which focus on modeling behavior according to the external usage of the system while maintaining an internal representation of cohesive business components. …


Pablo Manuelli

Principal iOS Software Engineer @ Trivia Crack — Etermax 🍎

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