NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

< Back to Hacking with Swift+

Creating a ShapeView to render UIBezierPaths

In the full episode…

  • Scaling a Bezier path
  • Animating shapes
  • Challenges
  • Further reading
Get the full 10:03 video by subscribing

Why subscribe?


Hacking with Swift+ delivers high-quality tutorials for subscribers, with each tutorial coming as a 4K Ultra HD video and in text form so you can read or watch – whatever works best for you.

So, you can get this full video and article as well as all other subscriber-only tutorials and all future tutorials – all by subscribing to Hacking with Swift+ today.

Subscribe to Hacking with Swift+

More from Hacking with Swift+


How to use phantom types in Swift

24:11

ADVANCED SWIFT

FREE: How to use phantom types in Swift

Phantom types are a powerful way to give the Swift compiler extra information about our code so that it can stop us from making mistakes. In this article I’m going to explain how they work and why you’d want them, as well as providing lots of hands-on examples you can try.

Using memoization to speed up slow functions

36:18

HIGH-PERFORMANCE APPS

FREE: Using memoization to speed up slow functions

In this article you’ll learn how memoization can dramatically boost the performance of slow functions, and how easy Swift makes it thanks to its generics and closures.

Trees

31:55

DATA STRUCTURES

FREE: Trees

Trees are an extraordinarily simple, extraordinarily useful data type, and in this article we’ll make a complete tree data type using Swift in just a few minutes. But rather than just stop there, we’re going to do something quite beautiful that I hope will blow your mind while teaching you something useful.

Creating a WaveView to draw smooth waveforms

32:08

CUSTOM SWIFTUI COMPONENTS

FREE: Creating a WaveView to draw smooth waveforms

In this article I’m going to walk you through building a WaveView with SwiftUI, allowing us to create beautiful waveform-like effects to bring your user interface to life.

Creating a RemoteImage to load images from the web

14:46

CUSTOM SWIFTUI COMPONENTS

Creating a RemoteImage to load images from the web

Just like UIKit before it, SwiftUI doesn’t come with built-in support for loading remote images, which makes it hard to get data from the internet. In this article I’ll show you how you can build a custom view that can fetch image from the internet, while also showing other images for different states.

Why opaque return types are so important

12:19

ADVANCED SWIFT

Why opaque return types are so important

Opaque return types are a powerful feature in Swift, and are also critically important for writing SwiftUI. In this article I’ll be explaining how they work, and why they give us more power than returning a simple protocol.

Linked lists

29:22

DATA STRUCTURES

Linked lists

If there’s one data structure they just love teaching you at school, it’s linked lists. In this article we’re going to look at why linked lists are so appealing, walk through how to build a linked list with Swift, and look at an alternative approach using enums.

Understanding assertions

27:33

INTERMEDIATE SWIFT

Understanding assertions

Assertions allow us to have Swift silently check the state of our program at runtime, but if you want to get them right you need to understand some intricacies. In this article I’ll walk you through the five ways we can make assertions in Swift, and provide clear advice on which to use and when.

The pros and cons of operator overloading

23:37

ADVANCED SWIFT

The pros and cons of operator overloading

I’ve written about operator overloading previously, not least in my book Pro Swift, but in the article I want to go into more depth on the places where it’s really useful – and the places where it’s not such a good idea.

Creating a StretchingHeader that sticks to the top of a view

18:35

CUSTOM SWIFTUI COMPONENTS

Creating a StretchingHeader that sticks to the top of a view

When users scroll beyond the top of a scroll view the default behavior is to show some empty space, but many apps prefer to show a stretchy header area instead. In this article I’ll show you how to build that SwiftUI, making an image that stays fixed to the top no matter what.

Making the most of optionals – part 2

20:24

ADVANCED SWIFT

Making the most of optionals – part 2

I already introduced how the internals of optionals work, including how they use conditional conformance and how to avoid infinitely sized structs. In this video I’m going to go further as we look at how our knowledge of Optional can be translated to Result, why it’s so important that optionals are functors and monads, and more.

Basic button customization using ButtonStyle

29:23

INTERMEDIATE SWIFTUI

Basic button customization using ButtonStyle

SwiftUI’s humble Button view is actually capable of doing remarkable things if you take the time to customize it. In this video I’ll be walking you through the ButtonStyle protocol, showing you how we can use it to make great-looking and reusable button effects.

Creating completely custom buttons using PrimitiveButtonStyle

19:21

INTERMEDIATE SWIFTUI

Creating completely custom buttons using PrimitiveButtonStyle

SwiftUI’s ButtonStyle lets us focus on how our buttons look, but not how they work, which in many situations is valuable. In this article we’ll look at a more advanced protocol, PrimitiveButtonStyle, and see how that gives us complete control over button functionality.

Creating a particle system in SwiftUI

56:53

SWIFTUI SPECIAL EFFECTS

Creating a particle system in SwiftUI

Particle systems let us create special effects such as confetti, fire, smoke, rain, and snow, all by adjusting a range of inputs. In this article we’re going to build our own particle system entirely driven by SwiftUI, so you can easily add some sparkle to your apps.

Animating buttons using ButtonStyle

15:44

INTERMEDIATE SWIFTUI

Animating buttons using ButtonStyle

SwiftUI’s ButtonStyle protocol is a great way to reuse designs across your app, to get a consistent look and feel everywhere. But they have one significant problem with animations, and in this article I’ll show you that problem in action, then walk you through how to fix it in a flexible way.

Creating a custom property wrapper using DynamicProperty

14:20

INTERMEDIATE SWIFTUI

Creating a custom property wrapper using DynamicProperty

It’s not hard to make a basic property wrapper, but if you want one that automatically updates the body property like @State you need to do some extra work. In this article I’ll show you exactly how it’s done, as we build a property wrapper capable of reading and writing documents from our app’s container.

Ordered sets

22:31

DATA STRUCTURES

Ordered sets

Arrays and sets have their own advantages and disadvantages, but what if we could combine them both to make an ordered set? We can! And in this article that’s exactly what we’ll do.

High-speed computation using Accelerate

36:34

HIGH-PERFORMANCE APPS

High-speed computation using Accelerate

Many coding problems are designed to perform the same operation on lots of data, and in fact they are so common Apple has a whole framework to make it better: Accelerate. In this video I’ll give you an introduction to Accelerate using practical examples so you can see just how easy it is.

Rendering a bar chart

24:57

RENDERING CHARTS IN SWIFTUI

Rendering a bar chart

Bar charts are one of the simplest and most common ways of representing data visually, and are often taught to kids at a young age. In this article I’ll show you how easy it is to render bar charts in SwiftUI, and show you various customization options to bring those charts to life.

Finding and fixing slow rendering

25:12

HIGH-PERFORMANCE APPS

Finding and fixing slow rendering

Instruments is a powerful tool for identifying performance problems, but in this article I’ll show you how to find code that slows down rendering in your app, causing slow scrolling, wasted CPU time, and more – all through the simulator.

Link copied to your pasteboard.