Advertisement · 728 × 90

Posts by Paul Hudson

How to add multiple configurations to a ModelContainer - a free SwiftData by Example tutorial Learn Swift coding for iOS with these free tutorials

You can pass multiple configurations into a single ModelContainer, handy for keeping some data in permanent storage and others in memory only. Just remember: related models must always share the same store! www.hackingwithswift.com/quick-start/...

3 hours ago 2 1 0 0
Allow Protocols to be Nested in Non-Generic Contexts – available from Swift 5.10 Allow Protocols to be Nested in Non-Generic Contexts example code from Swift 5.10

🏗️ Protocols with clashing names - like Transaction meaning three different things in the same app - can be nested inside the types that own them. Tidier namespacing, less chance of collision. www.hackingwithswift.com/swift/5.10/n...

1 day ago 9 0 0 0
Preview
Complexity Explorer – Hacking with Swift+ We're going to build an app that helps users learn about algorithm complexity, visualizing things like O(n²) and O(n!) using Swift Charts.

Sunday Build with HWS+: Visualize algorithm complexity with Swift Charts, from O(n) to O(n!), in a way that makes Big O notation click. #SundayBuild www.hackingwithswift.com/plus/live-st...

2 days ago 4 0 0 0
How to create multi-column lists using Table - a free SwiftUI by Example tutorial Learn Swift coding for iOS with these free tutorials

Table gives you sortable, selectable multi-column data on iPad and Mac, with support for custom cell views, column widths, and expandable rows via
DisclosureTableRow. www.hackingwithswift.com/quick-start/...

4 days ago 7 0 0 0
Preview
Making mistakes while learning Swift Tired of making mistakes while learning to code? You're not alone.

Every polished demo you've ever watched was built multiple times behind the scenes. Making mistakes isn't a sign you're failing - it's how learning actually works. Keep going! 🏅 www.hackingwithswift.com/articles/271...

5 days ago 11 2 0 0
Preview
Flood fill path finding – Hacking with Swift+ The flood fill approach to path finding is one of the easiest to learn, works great in games with small maps, and is also commonly used in software – filling a picture with color, for example. In this...

For HWS+ subscribers: Flood fill is one of the simplest path finding algorithms to understand, and it's the same technique used when you fill a region with color in a painting app. www.hackingwithswift.com/plus/algorit...

6 days ago 4 1 0 0
Using launch arguments to debug SwiftData and Core Data - a free SwiftData by Example tutorial Learn Swift coding for iOS with these free tutorials

Add -com.apple.CoreData.SQLDebug 1 as a launch argument and you can watch exactly what SwiftData is doing under the hood. Tip: don't delete it when you're done, just uncheck the box so it's ready when you need it again 🔍 www.hackingwithswift.com/quick-start/...

1 week ago 12 4 0 0
Precise Control Flags over Compiler Warnings – available from Swift 6.1 Precise Control Flags over Compiler Warnings example code from Swift 6.1

Not all warnings deserve the same treatment. Swift has per-diagnostic compiler flags, so you can promote specific warnings to errors, or protect certain ones from strict mode. ⚠️ www.hackingwithswift.com/swift/6.1/di...

1 week ago 6 0 0 0
Preview
Patch Match – Hacking with Swift+ In this stream we're going to build another game, but this time targeting visionOS. Although the game itself would work fine in 2D, in 3D it's really gorgeous because we'll be using an immersive space...

Sunday Build with HWS+: Launch a shape-matching game built for visionOS, where colorful identicons surround you in an immersive space and you race to find pairs. #SundayBuild www.hackingwithswift.com/plus/live-st...

1 week ago 2 0 0 0
Advertisement
How to dynamically adjust the appearance of a view based on its size and location - a free SwiftUI by Example tutorial Learn Swift coding for iOS with these free tutorials

The visualEffect() modifier gives you a geometry proxy without using GeometryReader, so you can add blur, hue rotation, and other effects based on a view's position without affecting layout. www.hackingwithswift.com/quick-start/...

1 week ago 11 0 0 0

It does!

1 week ago 2 0 1 0
SwiftUI Agent Skill - Write better code with Claude, Codex, and other AI tools Improve the AI-written code in all your SwiftUI projects with my free agent skill

There's an open-source SwiftUI agent skill that catches the mistakes AI tools keep making: deprecated modifiers, accessibility gaps, performance pitfalls. One command to install, and your AI-generated SwiftUI gets a serious quality boost. Try it out: www.hackingwithswift.com/articles/282...

1 week ago 24 7 4 0
Preview
Removing optionals from your code – Hacking with Swift+ Optionals are one of Swift’s most powerful features, letting us write code that is guaranteed to be safe as long as we check and unwrap them carefully. However, more often than not I prefer to avoid o...

For HWS+ subscribers: Optionals are powerful, but overusing them muddies intent and clutters code. Here are six practical techniques for cutting them down without sacrificing safety! www.hackingwithswift.com/plus/interme...

1 week ago 7 1 0 0
How to create a custom FetchDescriptor - a free SwiftData by Example tutorial Learn Swift coding for iOS with these free tutorials

FetchDescriptor gives you fine-grained control over your SwiftData queries - filtering, sorting, fetch limits, pagination, and even which properties to load. A lot of power in one place: www.hackingwithswift.com/quick-start/...

2 weeks ago 9 2 1 0
Swift Testing: Range-based confirmations – available from Swift 6.1 Swift Testing: Range-based confirmations example code from Swift 6.1

One of my favorite recent additions to Swift Testing is range-based confirmations, so we can write `await confirmation(expectedCount: 5...10)`. www.hackingwithswift.com/swift/6.1/sw...

2 weeks ago 12 1 0 0
Preview
LiveScribe – Hacking with Swift+ We're going to build a macOS app that lets users write Markdown and see exactly how it looks as they type. More importantly, we're going to do so using test-driven development, so get ready to write s...

Sunday Build with HWS+: Build a live Markdown previewer for macOS using test-driven development from start to finish. #SundayBuild www.hackingwithswift.com/plus/live-st...

2 weeks ago 7 1 0 0

Building Hacktivate is so much fun – seeing how much people learn about computer science while also enjoying themselves is just incredible. It is *packed* with real-world knowledge, all wrapped up in practical, engaging challenges. If you like it, please leave a review! 🙌

2 weeks ago 4 0 1 0
Advertisement
Preview
Hacktivate: Capture the Flag App - App Store Download Hacktivate: Capture the Flag by Hudson Heavy Industries on the App Store. See screenshots, ratings and reviews, user tips and more games like…

Hacktivate v1.11 is out! This is my most ambitious app update yet – 10 new cybersecurity challenges that are gigantic, challenging, and lots of fun. I can't wait to hear what you all think 😎 apps.apple.com/gb/app/hackt...

2 weeks ago 4 1 1 0

I don’t see why not!

2 weeks ago 1 0 0 0
Preview
GitHub - twostraws/Ignite: A static site generator for Swift developers. A static site generator for Swift developers. Contribute to twostraws/Ignite development by creating an account on GitHub.

Did you know you can build static websites using Swift code and SwiftUI-like syntax, with no HTML or CSS required? Ignite comes with built-in components like accordions, carousels, and syntax highlighting, plus a local preview server for testing. github.com/twostraws/Ig...

2 weeks ago 15 4 1 0
How to create an adaptive layout with ViewThatFits - a free SwiftUI by Example tutorial Learn Swift coding for iOS with these free tutorials

ViewThatFits tries each layout you provide and picks the first one that fits the available space 🎯 It's the easiest way to make your app look great on every screen size. www.hackingwithswift.com/quick-start/...

2 weeks ago 11 0 0 0
Preview
Agent skills in Xcode: How to install and use them today Get agent skills for Swift, SwiftUI, Swift Testing, and more

Agent skills are lightweight Markdown files that teach AI coding assistants things they don't already know, like deprecated APIs and platform-specific edge cases. They load into context on demand, so nothing gets wasted. www.hackingwithswift.com/articles/283...

2 weeks ago 12 2 2 0
Preview
Teach your AI to write Swift the Hacking with Swift way A hands-on AGENTS.md for Claude, Codex, and other AI tools that need firmer opinions about SwiftUI, Core Data, and particles.

Recently I launched four agent skills for Swift developers, but I left the best power up for last. Today I'm finally revealing exactly how to teach your AI to write Swift the Hacking with Swift way! #Boom www.hackingwithswift.com/articles/284...

2 weeks ago 16 1 4 2
How to create one-to-one relationships - a free SwiftData by Example tutorial Learn Swift coding for iOS with these free tutorials

True one-to-one relationships in SwiftData require both sides to be optional, or you'll hit a chicken-and-egg problem at creation time. www.hackingwithswift.com/quick-start/...

3 weeks ago 6 1 0 0
Advertisement
Allow trailing comma in comma-separated lists – available from Swift 6.1 Allow trailing comma in comma-separated lists example code from Swift 6.1

Where we’re going, we don’t need trailing commas! Or *do* we? Swift allows omitting them in certain circumstances, which can help make pull requests easier to read. www.hackingwithswift.com/swift/6.1/tr...

3 weeks ago 3 0 0 1
Preview
Flip – Hacking with Swift+ In this project we’re going to build a complete Reversi game with SwiftUI, including a strong AI opponent powered by Apple’s GameplayKit. It will look great and play great, and it’s easier to implemen...

Sunday Build with HWS+: Build a complete Reversi game in SwiftUI with a strong AI opponent powered by GameplayKit. #SundayBuild www.hackingwithswift.com/plus/live-st...

3 weeks ago 14 2 1 0
Preview
[Pitch] Initializers for joining a sequence of predicates Dear Swift community, Below is my pitch for constructing conjunctions and disjunctions from a variable number of predicates. I’ve designed the solution to address several use cases, including those d...

Nothing to see here, just a beautiful new Swift Evolution pitch that allows complex #Predicate building 🤯 It's early days, but this could perhaps become the NSCompoundPredicate equivalent SwiftData has been missing all this time 👀 forums.swift.org/t/pitch-init...

3 weeks ago 18 2 0 0
How to create a custom layout using the Layout protocol - a free SwiftUI by Example tutorial Learn Swift coding for iOS with these free tutorials

The Layout protocol lets you build fully custom layouts - radial arrangements, masonry grids, anything you can calculate - and use them just like HStack or VStack. Worth a look: www.hackingwithswift.com/quick-start/...

3 weeks ago 12 1 0 0
Preview
Learn essential Swift in one hour Here’s the least you need to know to get started with Swift.

One of the most popular videos I ever made: a rapid-fire tour of all core Swift concepts designed to be watched in a single sitting, from optionals to protocols to closures. Great for learners reviewing fundamentals or folks switching from other languages! www.hackingwithswift.com/articles/242...

3 weeks ago 11 1 1 0

Every day I walk from my house to a coworking space in town, and every day my kids drive past on their way to school. We call out and wave to each other, but it does wonders for locking in my focus – *that* is who I’m working for. I already know I’ll miss it when they leave home.

3 weeks ago 28 0 0 0