Advanced SwiftUI

At the end of each article, press the "Mark this article as read" button to have the site remember you've read it.

Getting the most from Canvas

23:20

Getting the most from Canvas

SwiftUI’s Canvas view is an extremely fast and efficient way to render custom graphics, but it’s also powerful – if you know what you’re doing you can unlock a huge amount of extra functionality to get the exact effect you’re looking for. Let’s look at six techniques here…

How to create Metal shaders for SwiftUI, part 1

27:41

How to create Metal shaders for SwiftUI, part 1

From iOS 17 onwards, we can dynamically adjust any SwiftUI views using Metal shaders. I’m going to show you how to do it, but not just how to apply them – I’m going to show you how to write your own shaders using Metal shading language! In this first article I’ll introduce how shaders work, along with some fundamental data types and a handful of Metal functions.

How to create Metal shaders for SwiftUI, part 2

32:02

How to create Metal shaders for SwiftUI, part 2

In this second part of our Metal shader exploration, we're going to look at making shaders adjust their results over time using a SwiftUI TimelineView.