Paul Hudson
@twostraws.bsky.social
📤 5812
📥 77
📝 295
I write Swift and write about Swift, but most people prefer my dogs.
pinned post!
Today I'm launching my new app, Hacktivate. It teaches real-world computer science skills through 240 "capture the flag" challenges, and works on iPhone, iPad, and Mac with one purchase. I've poured a ton of love into it, and I'd love to hear what you think 🙌
apps.apple.com/gb/app/hackt...
loading . . .
Hacktivate: Capture the Flag
Crack codes. Break firewalls. Conquer the map. Hacktivate is the ultimate cybersecurity challenge: a world map of 240 missions where every puzzle is built on real cybersecurity techniques hackers us...
https://apps.apple.com/gb/app/hacktivate-capture-the-flag/id6748286602
6 months ago
17
161
31
Use scrollTargetLayout() with .viewAligned to snap between individual child views, or .paging to move exactly one screen at a time.
www.hackingwithswift.com/quick-start/...
loading . . .
How to make a ScrollView snap with paging or between child views - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftui/how-to-make-a-scrollview-snap-with-paging-or-between-child-views
about 10 hours ago
0
6
1
After months of work, my new app is finally available to preorder on the Mac App Store. It's called Kickstart, and it has just one job: to help indie app developers make more money on the App Store. How does it do that? Let me explain…
1 day ago
2
20
5
What if you could build websites the same way you build SwiftUI apps, declaratively in pure Swift with no HTML required? That's the idea behind Ignite, and it works surprisingly well. 🔥
www.hackingwithswift.com/articles/266...
loading . . .
Build your next website in Swift
How Swift's result builders can help us write smarter, safer HTML.
https://www.hackingwithswift.com/articles/266/build-your-next-website-in-swift
1 day ago
1
10
2
For HWS+ subscribers: Building a fully scalable, animated clock face with Canvas and TimelineView is a satisfying exercise in precise, relative drawing - and it looks great at any size. 🕰️
www.hackingwithswift.com/plus/recreat...
loading . . .
Remaking the clock – Hacking with Swift+
Apple’s clock design has gone through a number of iterations over the years (not least for legal reasons!), and in this project we’ll seek to recreate the design used for the Clock app icon as of iOS ...
https://www.hackingwithswift.com/plus/recreating-ui/remaking-the-clock
2 days ago
0
8
0
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/...
loading . . .
How to add multiple configurations to a ModelContainer - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/how-to-add-multiple-configurations-to-a-modelcontainer
3 days ago
1
3
1
🏗️ 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...
loading . . .
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
https://www.hackingwithswift.com/swift/5.10/nested-protocols
4 days ago
0
9
0
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...
loading . . .
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.
https://www.hackingwithswift.com/plus/live-streams/complexity-explorer
5 days ago
0
4
0
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/...
loading . . .
How to create multi-column lists using Table - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-multi-column-lists-using-table
7 days ago
0
7
0
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...
loading . . .
Making mistakes while learning Swift
Tired of making mistakes while learning to code? You're not alone.
https://www.hackingwithswift.com/articles/271/making-mistakes-while-learning-swift
8 days ago
0
11
2
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...
loading . . .
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...
https://www.hackingwithswift.com/plus/algorithms/flood-fill-path-finding
9 days ago
0
4
1
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/...
loading . . .
Using launch arguments to debug SwiftData and Core Data - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/using-launch-arguments-to-debug-swiftdata-and-core-data
10 days ago
0
12
4
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...
loading . . .
Precise Control Flags over Compiler Warnings – available from Swift 6.1
Precise Control Flags over Compiler Warnings example code from Swift 6.1
https://www.hackingwithswift.com/swift/6.1/diagnostic-groups
11 days ago
0
6
0
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...
loading . . .
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...
https://www.hackingwithswift.com/plus/live-streams/patch-match
12 days ago
0
2
0
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/...
loading . . .
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
https://www.hackingwithswift.com/quick-start/swiftui/how-to-dynamically-adjust-the-appearance-of-a-view-based-on-its-size-and-location
14 days ago
0
11
0
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...
loading . . .
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
https://www.hackingwithswift.com/articles/282/swiftui-agent-skill-claude-codex-ai
15 days ago
4
24
7
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...
loading . . .
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...
https://www.hackingwithswift.com/plus/intermediate-swift/removing-optionals-from-your-code
16 days ago
0
7
1
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/...
loading . . .
How to create a custom FetchDescriptor - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/how-to-create-a-custom-fetchdescriptor
17 days ago
1
9
2
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...
loading . . .
Swift Testing: Range-based confirmations – available from Swift 6.1
Swift Testing: Range-based confirmations example code from Swift 6.1
https://www.hackingwithswift.com/swift/6.1/swift-testing-range-confirmations
18 days ago
0
12
1
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...
loading . . .
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...
https://www.hackingwithswift.com/plus/live-streams/livescribe
19 days ago
0
7
1
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...
loading . . .
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…
https://apps.apple.com/gb/app/hacktivate-capture-the-flag/id6748286602
20 days ago
1
4
1
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...
loading . . .
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.
https://github.com/twostraws/Ignite
20 days ago
1
15
4
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/...
loading . . .
How to create an adaptive layout with ViewThatFits - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-an-adaptive-layout-with-viewthatfits
21 days ago
0
11
0
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...
loading . . .
Agent skills in Xcode: How to install and use them today
Get agent skills for Swift, SwiftUI, Swift Testing, and more
https://www.hackingwithswift.com/articles/283/how-to-install-and-use-ai-agent-skills-in-xcode
22 days ago
2
12
2
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...
loading . . .
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.
https://www.hackingwithswift.com/articles/284/teach-your-ai-to-write-swift-the-hacking-with-swift-way
23 days ago
4
16
3
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/...
loading . . .
How to create one-to-one relationships - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/how-to-create-one-to-one-relationships
24 days ago
0
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...
loading . . .
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
https://www.hackingwithswift.com/swift/6.1/trailing-commas
25 days ago
0
3
1
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...
loading . . .
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...
https://www.hackingwithswift.com/plus/live-streams/flip
26 days ago
1
14
2
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...
loading . . .
[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...
https://forums.swift.org/t/pitch-initializers-for-joining-a-sequence-of-predicates/85652
28 days ago
0
18
2
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/...
loading . . .
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
https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-a-custom-layout-using-the-layout-protocol
28 days ago
0
12
1
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...
loading . . .
Learn essential Swift in one hour
Here’s the least you need to know to get started with Swift.
https://www.hackingwithswift.com/articles/242/learn-essential-swift-in-one-hour
29 days ago
1
11
1
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.
30 days ago
0
28
0
For HWS+ subscribers: Clouds, day/night cycles, rain, snow, lightning, stars, and even meteor showers - my nine-part series rebuilds the Weather app's stunning UI entirely in SwiftUI 🌦️
www.hackingwithswift.com/plus/remakin...
loading . . .
Starting with clouds – Hacking with Swift+
We’re going to pull apart then rebuild the user interface from the Weather app that shipped with iOS 15 onwards. The app itself is remarkably big, but we’re going to cherry pick all the interesting bi...
https://www.hackingwithswift.com/plus/remaking-weather/starting-with-clouds
about 1 month ago
2
14
2
SwiftData can infer relationships automatically, but explicit @Relationship saves headaches. My advice: always spell out your relationships rather than relying on inference.
www.hackingwithswift.com/quick-start/...
loading . . .
Inferred vs explicit relationships - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/inferred-vs-explicit-relationships
about 1 month ago
0
13
3
What's it like attending WWDC in person? I'm glad you asked, because I have a video just for you:
youtu.be/SneL19Jp1iE
#WWDC26
loading . . .
What it's like attending WWDC in Cupertino
YouTube video by Paul Hudson
https://youtu.be/SneL19Jp1iE
about 1 month ago
1
6
1
#WWDC26
is official! Kicks off June 8th, with a special event at Apple Park. I'm booking my flight as you read this, and will be in Cupertino with or without a golden ticket – see you there? 👀
developer.apple.com/wwdc26
loading . . .
WWDC26
Join the worldwide developer community online for a week of technology, creativity, and community.
https://developer.apple.com/wwdc26
about 1 month ago
1
12
2
🔍 Regular expressions in Swift aren't just string patterns — they're first-class types, checked at compile time, and can be written with a readable builder syntax – it's truly a thing of beauty.
www.hackingwithswift.com/swift/5.7/re...
loading . . .
Regular expressions – available from Swift 5.7
Regular expressions example code from Swift 5.7
https://www.hackingwithswift.com/swift/5.7/regexes
about 1 month ago
1
10
0
These (entirely unofficial) WWDC-themed community pins look delightful!
www.kickstarter.com/projects/csa...
loading . . .
WWDC — The Community Pins (ed. 2026)
Limited Edition Collector Set Celebrating Apple’s 50th Anniversary, WWDC 2026 & Its Developer Culture
https://www.kickstarter.com/projects/csauvage/wwdc-2026-the-unofficial-community-enamel-pins
about 1 month ago
1
10
2
Sunday Build with HWS+: Ever struggled with a complicated document? 🥴 This app uses Apple's Foundation Models to summarize it, then lets you talk to it to find exactly what you need.
#SundayBuild
www.hackingwithswift.com/plus/live-st...
loading . . .
DocQuery – Hacking with Swift+
Ever had a hard time understanding a complicated document? With AI we can not only summarize it clearly, but we can also let the user talk to the document to learn exactly what they need to know.
https://www.hackingwithswift.com/plus/live-streams/docquery
about 1 month ago
0
5
1
It was lovely and sunny today, so we all went to the Westbury White Horse for a walk – the dogs approved of the view, ignored the history, and hunted lots of real and imaginary things in the tall grass. 🌿
about 1 month ago
1
36
1
Making two views match sizes in SwiftUI is surprisingly simple: give each an infinite max frame in the direction you want, then apply fixedSize() to the container. No GeometryReader required. See how it works:
www.hackingwithswift.com/quick-start/...
loading . . .
How to make two views the same width or height - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftui/how-to-make-two-views-the-same-width-or-height
about 1 month ago
0
17
1
compacted() replaces the common compactMap { $0 } pattern, product() eliminates nested for-loops, and uniqued() removes duplicates from any sequence. Apple's Swift Algorithms package is full of small wins like these. Have a look:
www.hackingwithswift.com/articles/243...
loading . . .
Write better code with Swift Algorithms
Write faster, simpler, safer Swift code with this powerful open-source package.
https://www.hackingwithswift.com/articles/243/write-better-code-with-swift-algorithms
about 1 month ago
2
23
4
For HWS+ subscribers: Memoization caches function results so the same work never runs twice, and Swift's closures and generics make it elegant to implement.
www.hackingwithswift.com/plus/high-pe...
loading . . .
Using memoization to speed up slow functions – Hacking with Swift+
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.
https://www.hackingwithswift.com/plus/high-performance-apps/using-memoization-to-speed-up-slow-functions
about 1 month ago
1
4
0
SwiftData's
#Predicate
macro looks like pure Swift but gets compiled into something else entirely. Some things crash at runtime, some silently return nothing, and !value can behave differently to value == false. 😅
www.hackingwithswift.com/quick-start/...
loading . . .
How to filter SwiftData results with predicates - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftdata/how-to-filter-swiftdata-results-with-predicates
about 1 month ago
0
14
1
Back in Swift 5.9, if and switch were adjusted to work like expressions so you can assign their result directly to a variable. Clean and consistent, or hard to read? 🤔
www.hackingwithswift.com/swift/5.9/if...
loading . . .
if and switch expressions – available from Swift 5.9
if and switch expressions example code from Swift 5.9
https://www.hackingwithswift.com/swift/5.9/if-switch-expressions
about 1 month ago
2
12
1
Here's the first Sunday Build with HWS+: Got an old iPad collecting dust? 🖼️ Turn it into a digital photo slideshow app with SwiftData, albums, and adjustable playback speed.
#SundayBuild
Check it out:
www.hackingwithswift.com/plus/live-st...
loading . . .
Framed – Hacking with Swift+
What can be done with old iPads? Rather than contributing to increasing amounts of e-waste, we can give them a nice lease of life as a digital photo slideshow!
https://www.hackingwithswift.com/plus/live-streams/framed
about 1 month ago
3
56
6
Every Sunday I’m going to post a Sunday Build – a complete app you can build from scratch. Each one includes a full build tutorial with video and finished source code, so follow along and ship something! (And if you don’t want a weekly stream of app ideas, mute
#SundayBuild
.)
about 1 month ago
2
59
3
SwiftUI's humble Text view is the foundation of almost every layout, but there's more to it than just showing a string – reserving space is a great way to keep your layouts consistent!
www.hackingwithswift.com/quick-start/...
loading . . .
How to create static labels with a Text view - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-static-labels-with-a-text-view
about 1 month ago
1
52
5
Last week I released SwiftUI Pro, a free and open-source agent skill to help everyone write better SwiftUI code using agents such as Codex and Claude. It's already at 1800 stars on GitHub and rising, but it was just the beginning.
github.com/twostraws/Sw...
loading . . .
GitHub - twostraws/SwiftUI-Agent-Skill: SwiftUI agent skill for Claude Code, Codex, and other AI tools.
SwiftUI agent skill for Claude Code, Codex, and other AI tools. - twostraws/SwiftUI-Agent-Skill
https://github.com/twostraws/SwiftUI-Agent-Skill
about 1 month ago
3
41
5
reposted by
Paul Hudson
Peter Friese
about 2 months ago
A new CLI skill to automatically review your SwiftUI codebase for accessibility and best practices. by
@twostraws.bsky.social
github.com/twostraws/S...
loading . . .
GitHub - twostraws/SwiftUI-Agent-Skill: SwiftUI agent skill for Claude Code, Codex, and other AI tools.
SwiftUI agent skill for Claude Code, Codex, and other AI tools. - twostraws/SwiftUI-Agent-Skill
https://github.com/twostraws/SwiftUI-Agent-Skill
1
6
2
My SwiftUI agent skill has now passed 1,000 GitHub stars in just two days – I appreciate you all so much! 🙇♂️ So many people have replied to say it has already helped Codex, Claude Code, and other agents find and fix problems in just a few minutes.
github.com/twostraws/sw...
loading . . .
GitHub - twostraws/SwiftUI-Agent-Skill: SwiftUI agent skill for Claude Code, Codex, and other AI tools.
SwiftUI agent skill for Claude Code, Codex, and other AI tools. - twostraws/SwiftUI-Agent-Skill
https://github.com/twostraws/swiftui-agent-skill
about 2 months ago
5
55
4
Load more
feeds!
log in