Sign in

Paul Hudson

@twostraws.bsky.social
6.6K followers 77 following 508 posts

I write Swift and write about Swift, but most people prefer my dogs.

PostsRepliesMedia
Paul Hudson @twostraws.bsky.social · 12h
For HWS+ subscribers: When JSON is messy or completely unstructured, Codable becomes more trouble than it's worth. A custom JSON type with @dynamicMemberLookup can let you dig through any structure using clean dot syntax. www.hackingwithswift.com/plus/working...
hackingwithswift.com
Parsing difficult JSON – Hacking with Swift+
If you have nice, clean JSON then using Swift and Codable is like a dream come true. But what if you have messy JSON, or JSON where you really don’t know what you’ll receive ahead of time? In this art...
040
Paul Hudson @twostraws.bsky.social · 29/09/2026
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/...
hackingwithswift.com
How to add multiple configurations to a ModelContainer - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
010
Paul Hudson @twostraws.bsky.social · 28/09/2026
Migrating a large project to Swift concurrency is a big ask all at once. @preconcurrency lets you annotate modules and individual APIs as "pre-concurrency" to suppress warnings incrementally, buying yourself time to migrate properly. www.hackingwithswift.com/swift/5.6/pr...
hackingwithswift.com
More concurrency changes – available from Swift 5.6
More concurrency changes example code from Swift 5.6
081
Paul Hudson @twostraws.bsky.social · 27/09/2026
Sunday Build with HWS+: Why not try a deceptively simple SwiftUI game: tap the one green circle in a grid of red ones before time runs out, with multiple difficulty variations to keep things interesting. #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Flashlight – Hacking with Swift+
In this stream we're going to build a trivial game with SwiftUI, but then look at ways we can make it more interesting through difficulty variations – there's so much room to experiment!
061
Paul Hudson @twostraws.bsky.social · 25/09/2026
The symbolEffect() modifier adds bounce, pulse, variable color, and rotation animations to SF Symbols with almost no effort. Multi-layer symbols can even animate each layer individually ✨ www.hackingwithswift.com/quick-start/...
hackingwithswift.com
How to animate SF Symbols - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
030
Paul Hudson @twostraws.bsky.social · 23/09/2026
For HWS+ subscribers: A* isn't guaranteed to find the single perfect route, but it's fast, practical, and close enough to optimal that it's the go-to choice for path finding in both games and apps. www.hackingwithswift.com/plus/algorit...
hackingwithswift.com
A* path finding – Hacking with Swift+
The A* algorithm for path finding is not the perfect way to find an optimal route between two nodes in a graph, but it is either the best or darned close most of the time and that makes it a fantastic...
031
Paul Hudson @twostraws.bsky.social · 22/09/2026
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/...
hackingwithswift.com
Using launch arguments to debug SwiftData and Core Data - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
0143
Paul Hudson @twostraws.bsky.social · 21/09/2026
Primary associated types let you write any Collection<String> instead of juggling type erasure. It's a cleaner, more expressive way to work with protocols that have associated types you care about. www.hackingwithswift.com/swift/5.7/pr...
hackingwithswift.com
Lightweight same-type requirements for primary associated types – available from Swift 5.7
Lightweight same-type requirements for primary associated types example code from Swift 5.7
061
Paul Hudson @twostraws.bsky.social · 20/09/2026
Sunday Build with HWS+: Bake a slice of Pi! Create a macOS app that helps you memorize the digits of pi by mapping numbers to letters, then building stories from them. 🥧 #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Slice of Pi – Hacking with Swift+
In this stream we're going to build a macOS app that helps you remember the digits of pi. The concept is simple, and a rough implementation is simple, but then we'll make it better!
043
Paul Hudson @twostraws.bsky.social · 20/09/2026
Sunday Build with HWS+: Bake a slice of Pi! Create a macOS app that helps you memorize the digits of pi by mapping numbers to letters, then building stories from them. 🥧 #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Slice of Pi – Hacking with Swift+
In this stream we're going to build a macOS app that helps you remember the digits of pi. The concept is simple, and a rough implementation is simple, but then we'll make it better!
011
Paul Hudson @twostraws.bsky.social · 19/09/2026
Today's Hacking with Swift+ livestream is at 5pm UK time / 9am Pacific! We're going hard on Foundation Models with Private Cloud Compute – easily my favorite iOS 27 feature. We're building a complete app from scratch, and as usual I hope someone ships it! www.hackingwithswift.com/plus
hackingwithswift.com
Hacking with Swift+
Subscribe to Hacking with Swift+ and get advanced Swift tutorials to help take your career to the next level.
021
Paul Hudson @twostraws.bsky.social · 16/09/2026
It took two months to build Kickstart 2.0 because it was so feature-packed. 2.1 will ship faster, but to help you stay up to date I'm starting a (very irregular!) email newsletter – Kickstart news, yes, but also app growth tips and more. Sign up free here: newsletter.kickstart.tools
newsletter.kickstart.tools
Main landing page
Subscribe to the Kickstart newsletter, and grow your success on the App Store.
040
Paul Hudson @twostraws.bsky.social · 14/09/2026
I'm really pleased to announce Kickstart 2.0 is available now, with huge upgrades for keyword tracking, private AI integration, design inspiration, and more! www.kickstart.tools/blog/kicksta...
kickstart.tools
Kickstart 2.0: The best ASO tool just got better
Kickstart’s keyword tracking has had a huge upgrade, making it easier than ever to find winning keywords on the App Store.
250
Paul Hudson @twostraws.bsky.social · 13/09/2026
Final checks complete: Kickstart 2.0 is ready to launch tomorrow, alongside macOS Golden Gate. It is *packed* with incredible new features, and I can't wait to share them with you 🤩
0101
Paul Hudson @twostraws.bsky.social · 13/09/2026
Sunday Build with HWS+: Ship a language learning app designed to help you master hiragana and katakana, introducing new characters one at a time and reinforcing them through repetition. #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Kana Quest – Hacking with Swift+
In this stream we're going to build a small app for language learners, then add some upgrades to make it both more pretty and more useful.
451
Paul Hudson @twostraws.bsky.social · 11/09/2026
SwiftUI's PhotosPicker brings up the system photo picker and supports powerful filtering: screenshots only, everything except videos, or any combination you need. www.hackingwithswift.com/quick-start/...
hackingwithswift.com
How to let users select pictures using PhotosPicker - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
070
Paul Hudson @twostraws.bsky.social · 10/09/2026
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...
hackingwithswift.com
Agent skills in Xcode: How to install and use them today
Get agent skills for Swift, SwiftUI, Swift Testing, and more
4131
Paul Hudson @twostraws.bsky.social · 09/09/2026
For HWS+ subscribers: register(defaults:) is a much cleaner way to set initial UserDefaults values, and this article also covers sharing preferences across app extensions and syncing them to iCloud. Worth a look: www.hackingwithswift.com/plus/making-...
hackingwithswift.com
Storing preferences efficiently – Hacking with Swift+
Apple’s UserDefaults system lets us store small amounts of user data for our app, which might sound simple but it’s deceptively powerful. In this article I’ll show you the correct way to create initia...
010
Paul Hudson @twostraws.bsky.social · 08/09/2026
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/...
hackingwithswift.com
How to create a custom FetchDescriptor - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
020
Paul Hudson @twostraws.bsky.social · 07/09/2026
I'm doing some research on App Store keywords and could use some help. If you have a moment, please (anonymously!) add your app's App Store keywords here: forms.gle/ezY6hwSfTMt2... – don't post the app's name or URL; I don't want to know. Just some of the keywords you care about.
forms.gle
Anonymous App Store Keywords
I'm doing some research on App Store keywords, and would appreciate it if you could enter the keywords your app uses below. Please DO NOT identify your app – no app name or subtitle! I do NOT want to ...
044
Paul Hudson @twostraws.bsky.social · 07/09/2026
Protocols with Self or associated type requirements used to be restricted from use as existential types. That restriction is lifted, so any Equatable and similar are now valid where they previously were not. www.hackingwithswift.com/swift/5.7/un...
hackingwithswift.com
Unlock existentials for all protocols – available from Swift 5.7
Unlock existentials for all protocols example code from Swift 5.7
041
Paul Hudson @twostraws.bsky.social · 06/09/2026
Sunday Build with HWS+: Minesweeper, built entirely in SwiftUI? Oh yes! Simple rules, surprisingly tricky logic, and a great exercise in grid-based game design. #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Minesweeper – Hacking with Swift+
Despite this game originally being made in the early 80s, Minesweeper remains as popular as ever. But can we make it wholly with SwiftUI? Of course we can!
0110
Paul Hudson @twostraws.bsky.social · 04/09/2026
Some SF Symbols support variable coloring, where different parts fill based on a fraction between 0 and 1. Bind that value to a slider or other state and the icon updates in real time. www.hackingwithswift.com/quick-start/...
hackingwithswift.com
How to dynamically adjust the color of an SF Symbol - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
050
Paul Hudson @twostraws.bsky.social · 03/09/2026
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...
hackingwithswift.com
Learn essential Swift in one hour
Here’s the least you need to know to get started with Swift.
092
Paul Hudson @twostraws.bsky.social · 02/09/2026
For HWS+ subscribers: Sprinkling optionals across your Codable types handles version changes but creates real semantic confusion. Nested versioned structs keep your main type clean and contain all the messy migration logic in one place. www.hackingwithswift.com/plus/interme...
hackingwithswift.com
Versioning Codable data – Hacking with Swift+
Codable is the fastest and easiest way to store Swift objects, but what happens when your data types need to evolve to add extra information? In this tutorial I’ll show you the traditional way this is...
131
Paul Hudson @twostraws.bsky.social · 02/09/2026
It looks like Kickstart Exchange will pass 300 apps in just a couple of days – who wants to be the lucky number? 🙂 Indie developers promoting other indie developers, all free: exchange.kickstart.tools
exchange.kickstart.tools
Kickstart Exchange: free advertising for indie app developers
Your app shows ads for other indie apps, and every two shown earn one view of yours. Free, with no user tracking.
130
Paul Hudson @twostraws.bsky.social · 01/09/2026
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/...
hackingwithswift.com
How to create one-to-one relationships - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
121
Paul Hudson @twostraws.bsky.social · 31/08/2026
Pro tip for folks working with Apple documentation: add ".md" to the end of a URL to get it as Markdown – much lighter to load, and also friendlier for agents. Example: developer.apple.com/documentatio...
developer.apple.com
24310
Paul Hudson @twostraws.bsky.social · 31/08/2026
Opaque return types used to mean a single concrete type hidden behind some Protocol. Structural opaque types extend this so you can return things like (some View, some View) or [some Hashable] - more flexibility, same type safety guarantees. www.hackingwithswift.com/swift/5.7/st...
hackingwithswift.com
Structural opaque result types – available from Swift 5.7
Structural opaque result types example code from Swift 5.7
021
Paul Hudson @twostraws.bsky.social · 30/08/2026
I totally missed that Kickstart Exchange has now passed 250 apps – we're at 265 now! Not bad for less than two weeks of existence 😎 Promote your apps for free! exchange.kickstart.tools
exchange.kickstart.tools
Kickstart Exchange: free advertising for indie app developers
Your app shows ads for other indie apps, and every two shown earn one view of yours. Free, with no user tracking.
020
Paul Hudson @twostraws.bsky.social · 28/08/2026
New on the Kickstart blog: Free App Store optimization tools for indie developers 💸 Seven free browser tools and guides for improving your App Store keywords, pricing, metadata, reviews, screenshots, icons, and press kit. www.kickstart.tools/blog/free-ap...
kickstart.tools
Free App Store optimization tools for indie developers
Seven free browser tools and guides for improving your App Store keywords, pricing, metadata, reviews, screenshots, icons, and press kit.
0152
Paul Hudson @twostraws.bsky.social · 28/08/2026
SwiftUI's trim() modifier lets you draw only a portion of any shape by specifying start and end values between 0 and 1. It's perfect for building custom progress indicators with just a few lines of code. www.hackingwithswift.com/quick-start/...
hackingwithswift.com
How to draw part of a solid shape using trim() - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
141
Paul Hudson @twostraws.bsky.social · 28/08/2026
We're about three weeks away from the release of macOS 27, so I'm in the final phase of building new features for the next Kickstart update. The main work is done, it's now just testing, testing, and more testing. It's going to be the biggest update yet 🔥 www.kickstart.tools
kickstart.tools
Kickstart: The app that helps indie developers ship
Kickstart is the Mac app for tracking App Store keywords, optimizing Apple Ads, understanding reviews and analytics, and growing your app.
181
Paul Hudson @twostraws.bsky.social · 27/08/2026
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. www.hackingwithswift.com/articles/243...
hackingwithswift.com
Write better code with Swift Algorithms
Write faster, simpler, safer Swift code with this powerful open-source package.
0122
Paul Hudson @twostraws.bsky.social · 26/08/2026
New on the Kickstart blog, a follow-up to the previous post: How to turn TestFlight feedback reports into a fix list in 20 minutes! www.kickstart.tools/blog/from-te...
kickstart.tools
TestFlight feedback: How to turn tester reports into a fix list in 20 minutes
A practical workflow for triaging TestFlight crashes and screenshot feedback, prioritizing serious bugs, and turning useful reports into actionable tasks.
040
Paul Hudson @twostraws.bsky.social · 26/08/2026
For HWS+ subscribers: Swift has five assertion functions and they each behave differently depending on your build settings, so knowing which one to reach for matters more than it might seem. Explore more: www.hackingwithswift.com/plus/interme...
hackingwithswift.com
Understanding assertions – Hacking with Swift+
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 t...
050
Paul Hudson @twostraws.bsky.social · 25/08/2026
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/...
hackingwithswift.com
Inferred vs explicit relationships - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
0101
Paul Hudson @twostraws.bsky.social · 25/08/2026
New on the Kickstart blog: TestFlight beta testing best practices – run a beta that actually improves your app. How to recruit testers who respond, give them tasks instead of builds, write What to Test notes that get read, and know when to ship. www.kickstart.tools/blog/testfli...
kickstart.tools
TestFlight beta testing best practices: run a beta that actually improves your app
How to recruit TestFlight testers who respond, give them tasks instead of builds, write What to Test notes that get read, and know when to ship.
040
Paul Hudson @twostraws.bsky.social · 24/08/2026
"Swift version" has always meant two things - the compiler version and the language mode - and that confusion is real. 🤔 Swift formalizes "language mode" as the official term. www.hackingwithswift.com/swift/6.1/la...
hackingwithswift.com
Formalize ‘language mode’ terminology – available from Swift 6.1
Formalize ‘language mode’ terminology example code from Swift 6.1
061
Paul Hudson @twostraws.bsky.social · 23/08/2026
Sunday Build with HWS+: Craft a word game where players spell words from a grid of letters, but each word must match a special rule like "must contain at least 5 letters" or "must start and end with the same letter." #SundayBuild www.hackingwithswift.com/plus/live-st...
hackingwithswift.com
Wordcraft – Hacking with Swift+
This month we're going to make another game, and it's one that been rattling around my head for so long that I'm glad to finally be able to share it with you!
061
Paul Hudson @twostraws.bsky.social · 21/08/2026
New on the Kickstart blog: 6 ways to promote your app without spending a penny. Six free ways to get your app in front of more people, and how much time each one actually takes. www.kickstart.tools/blog/6-ways-...
kickstart.tools
6 ways to promote your app without spending a penny
Six free ways to get your app in front of more people, and how much time each one actually takes.
050
Paul Hudson @twostraws.bsky.social · 21/08/2026
Instead of stretching an image to fill space, SwiftUI can tile it by repeating horizontally and vertically. Just pass .tile to the resizable() modifier's resizingMode parameter. www.hackingwithswift.com/quick-start/...
hackingwithswift.com
How to tile an image - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
160
Paul Hudson @twostraws.bsky.social · 20/08/2026
If you're passing raw strings around for things like usernames and email addresses, you're scattering validation checks everywhere. Value objects with failable initializers mean invalid instances literally can't exist. www.hackingwithswift.com/articles/188...
hackingwithswift.com
Improving your Swift code using value objects
They’re like super-charged value types.
061
Paul Hudson @twostraws.bsky.social · 19/08/2026
New on the Kickstart blog: App Store offer codes – how to track campaigns, win back subscribers, and grow your app. Offer codes can associate redemption activity directly with a campaign, which makes them a fantastic marketing tool – when used wisely! www.kickstart.tools/blog/app-sto...
kickstart.tools
App Store offer codes: How to track campaigns, win back subscribers, and grow your app
Apple offer codes can associate redemption activity with a campaign. Here’s how subscription and in-app purchase codes differ, and how to distribute them safely.
040
Paul Hudson @twostraws.bsky.social · 19/08/2026
For HWS+ subscribers: Structs have single owners, which is usually exactly what you want, but wrapping one in a generic Box class is the cleanest way to share it safely when you genuinely need to. www.hackingwithswift.com/plus/interme...
hackingwithswift.com
The ultimate Box type – Hacking with Swift+
Boxing allows us to wrap up a struct in a class, to make it easy to share in several places. I’ve touched on boxing briefly previously, but here I want to take the concept much further to add useful p...
030
Paul Hudson @twostraws.bsky.social · 18/08/2026
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/...
hackingwithswift.com
How to filter SwiftData results with predicates - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
051
Paul Hudson @twostraws.bsky.social · 18/08/2026
Kickstart Exchange launched exactly 24 hours ago, and already has 115 apps onboard! 🎉 It’s a free advertising network to help indie app developers grow: you show ads for other apps, and they show ads for you – everyone wins. Sign up today: exchange.kickstart.tools
exchange.kickstart.tools
Kickstart Exchange: free advertising for indie app developers
Your app shows ads for other indie apps, and every two shown earn one view of yours. Free, with no user tracking.
150
Paul Hudson @twostraws.bsky.social · 17/08/2026
New on the Kickstart blog: How to promote your App Store app for free with Kickstart Exchange. It's a new, free cross-promotion service for indie apps – here’s how to get started today! www.kickstart.tools/blog/how-to-...
kickstart.tools
How to promote your App Store app for free with Kickstart Exchange
Kickstart Exchange is a free cross-promotion service for indie apps – here’s how to get started today!
162
Paul Hudson @twostraws.bsky.social · 17/08/2026
Top-level Swift code - scripts and playgrounds - can use await directly without needing to wrap everything in a task or a dedicated @main type. A genuine quality of life win for scripting and quick experiments. www.hackingwithswift.com/swift/5.7/to...
hackingwithswift.com
Concurrency in top-level code – available from Swift 5.7
Concurrency in top-level code example code from Swift 5.7
0101
Paul Hudson @twostraws.bsky.social · 17/08/2026
Today I’m really proud to launch Kickstart Exchange: a free service that provides advertising for indie app developers. You show small adverts in your app, and in exchange adverts for your apps appear elsewhere – it's a link exchange! exchange.kickstart.tools
exchange.kickstart.tools
Kickstart Exchange: free advertising for indie app developers
Your app shows ads for other indie apps, and every two shown earn one view of yours. Free, with no user tracking.
2135