Controlling Visibility

In the last post we discussed the appearance properties of our views and layers, giving them some visual content. But we only discussed how they appear, not whether they appear. It’s often convenient to control our views’ visibility separate from whether or not they’re in the view hierarchy. And we can take this one step further and control what portion of our views are visible. Let’s dive in!

Read more

The Fundamental Appearance Properties of Views and Layers

The first couple posts in this series have focused on the mechanics of building up view and layer hierarchies and the properties used to arrange those hierarchies. But so far we haven’t talked about how to get our views and layers to show any content. In this post we’ll dive into making our UI look interesting by exploring three fundamental appearance attributes shared by all layers and with each of them open up a discussion into an interesting broader technical concept. Let’s get started!

Read more

Transforming Views and Layers

There’s one more key building block we need to explore when it comes to establishing where a view/layer is drawn in the hierarchy: transforms.

Applying a transform to a view allows you to change where its contents are drawn without affecting its underlying size or position. This is mainly used for temporary changes to a view, which is especially useful around things like animations.

Read more

The Foundational Building Blocks of iOS UI

When you look at an app running on your device, you should see a single, cohesive interface that fits together seamlessly. Physical interfaces, like the keyboard on your computer, are made by attaching smaller components together to create a single product. Software interfaces are made the same way - building the final rendered pixels you see on screen from layers of building blocks beneath. Unlike your keyboard, though, you can’t take an app’s UI apart to see how it’s built.

On iOS, there are many levels of abstraction between how you define a UI in code and the pixels drawn to the screen. Each of these levels of abstraction solves some very interesting problems and can be fascinating to learn about. Let’s start by talking about one of the most important UI frameworks for iOS: UIKit.

Read more