Creating a Tag Cloud for macOS

David Piper
5 min readJul 15, 2021

Creating a resizable and reusable view for a macOS app

Creating a macOS app allows us to use a whole different set of tools than creating an iOS app. In this article we’ll look at one example of a view we can only use at the mac: A Tag Cloud that reacts to resizing and places its tags according to the given space. This is a demo of TagCloudView:

Demo of TagCloudView with 4 tags.

First, we’re going to look at how to create the rows and how to place tags in them. But this initial setup will not allow resizing, we’ll handle this in the next section. Next, we’ll see how to use and configure the Tag Cloud. At the end of the article, the usage of this view is demonstrated in an app.

Creating the Rows

TagCloudView consists of many rows, each holding a different number of tags. Here you can see this setup:

Structure of TagCloudView.

First, let’s start by creating the views and see how to place the tags.

--

--