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.
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.
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.
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.
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.
There are lots of UI mistakes we can make in programming, but unless our bugs actually get in the way of functionality most users don’t care that much. But there is one exception, and we’re going to look at it here: in this article I’ll show you how to handle names correctly – the most personal data of all.
In this article we’re going to look at how to rebuild the Tips app using SwiftUI, including how to make scrolling tabs of content, how to get a parallax scrolling effect, and more.
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.
Swift’s optionals are implemented as simple enums, with just a little compiler magic sprinkled around as syntactic sugar. However, they do much more than people realize, and in this article I’m going to demonstrate some of their power features that can really help you write better code – and blow your mind along the way.
So much of our job is about downloading JSON data, decoding it using
Codable, then presenting it – it’s a core skill. But it’s common to see folks rely on huge libraries such as Alamofire, or get mixed up with
URLSession. So, in this article we’ll look at how to rewrite common networking code using Combine, then add some generics to make it truly flexible.
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.
Apple’s Foundation framework makes it easy for us to convert any kind of measurement into any other kind of measurement. In this article I’ll show you how to make the most of these APIs, but also why it’s so useful that they work with Swift features such as operator overloading, plus important protocols such as
Generics are one of the most powerful features of Swift, allowing us to write code once and reuse it in many ways. In this article we’ll explore how they work, why adding constraints actually helps us write more code, and how generics help solve one of the biggest problems in Swift.
Now that we’ve covered stacks and linked lists, queues and deques ought to be easier. In this article we’ll build both data structures in just a few lines of Swift, then explore interesting additions such as
In this second tutorial on generics, we’re going to explore creating several different generic types, look at extending generics, and look at how we can apply our generics knowledge to create property wrappers.
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.
A sorted array is one that retains a correct sort order no matter how and when you add items. Although this sounds simple enough to implement, in this article you’ll see that it’s actually quite fun to explore because there are a number of interesting challenges we’ll face.
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.
In this article we’re going to look at how easy it is to rebuild the iOS lock screen. Yes, this isn’t hard, but along the way I think you’ll pick up a few cool SwiftUI tricks, including better date formatting, haptic buttons, and more.
Many apps show lots of data in a list, and allow users to filter that list by typing in a text view. In this article we’re going to build that in SwiftUI, then pull it out into a reusable component you can apply anywhere.
In a previous article I showed you a smart, simple and safe way of fetching data from the internet using Combine. This article I want to look at how to handle multiple network requests safely, ensuring that both complete before you update your user interface.
Link copied to your pasteboard.