Paul Hudson
@twostraws.bsky.social
I write Swift and write about Swift, but most people prefer my dogs.
Combining opaque types with primary associated types, you can write any Sequence<String> to express "any sequence of strings" - a constrained existential. The generics story in Swift keeps getting better. www.hackingwithswift.com/swift/5.7/co...
Constrained existential types – available from Swift 5.7
Constrained existential types example code from Swift 5.7
hackingwithswift.com
Somewhere out there is the GOAT who designed the classic iOS 6 Passbook shredding animation. I hope they are having a great day. ✨
safeAreaInset() lets you place content outside the safe area while automatically adjusting other views so nothing gets hidden. It works beautifully with ScrollView, List, and Form. www.hackingwithswift.com/quick-start/...
How to inset the safe area with custom content - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
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. www.hackingwithswift.com/articles/271...
Making mistakes while learning Swift
Tired of making mistakes while learning to code? You're not alone.
hackingwithswift.com
I'm pleased to announce v2.0 of my SwiftUI Pro agent skill! It's packed with improvements based on real-world testing of iOS 27 and iPhone Duo, and also integrates a variety of advice from Apple's own skills. Get it here: github.com/twostraws/sw...
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
github.com
For HWS+ subscribers: There's more to good networking than just fetching data. NWPathMonitor and URLSessionConfiguration let you respect the user's connection, wait for connectivity, and avoid expensive requests. www.hackingwithswift.com/plus/network...
User-friendly network access – Hacking with Swift+
Anyone can write Swift code to fetch network data, but much harder is knowing how to write code to do it respectfully. In this article we’ll look at building a considerate network stack, taking into a...
hackingwithswift.com
Codable structs and enums work as SwiftData properties, but collections like [String] get stored as binary data and can't be used in predicates. Tread *carefully*. www.hackingwithswift.com/quick-start/...
Using structs and enums in SwiftData models - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
Long, complex type annotations got a bit more manageable. Write _ for the parts you want Swift to infer, and spell out only what matters. A small addition, but surprisingly handy when working with deeply nested generic types. 🧩 www.hackingwithswift.com/swift/5.6/ty...
Type placeholders – available from Swift 5.6
Type placeholders example code from Swift 5.6
hackingwithswift.com
Sunday Build with HWS+: Build a SwiftData app that monitors your Xcode build times, then calculates how much time and money you'd save by upgrading hardware. #SundayBuild www.hackingwithswift.com/plus/live-st...
Upgrade your Mac – Hacking with Swift+
In this stream we're going to build a SwiftUI and SwiftData app that monitors how long Xcode takes to build your projects, then uses that to calculate how much time and money you would save by upgradi...
hackingwithswift.com
The .drawOn symbol effect animates SF Symbols as if they're being drawn with a pen, with three speed options for controlling how layers animate. www.hackingwithswift.com/quick-start/...
How to make SF Symbols draw themselves - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
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. www.hackingwithswift.com/articles/282...
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
hackingwithswift.com
📨 The Kickstart newsletter: every issue will have one tip for App Store success, and the latest news on my Kickstart app. It will be fairly irregular, and sent only when I have something to say. First issue goes out today! newsletter.kickstart.tools
Kickstart news and app growth tips
Subscribe to the Kickstart newsletter, and grow your success on the App Store.
newsletter.kickstart.tools
📨 The Kickstart newsletter: every issue will have one tip for App Store success, and the latest news on my Kickstart app. It will be fairly irregular, and sent only when I have something to say. First issue goes out today! newsletter.kickstart.tools
Kickstart news and app growth tips
Subscribe to the Kickstart newsletter, and grow your success on the App Store.
newsletter.kickstart.tools
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...
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...
hackingwithswift.com
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/...
How to add multiple configurations to a ModelContainer - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
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...
More concurrency changes – available from Swift 5.6
More concurrency changes example code from Swift 5.6
hackingwithswift.com
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...
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!
hackingwithswift.com
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/...
How to animate SF Symbols - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
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...
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...
hackingwithswift.com
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/...
Using launch arguments to debug SwiftData and Core Data - a free SwiftData by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com
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...
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
hackingwithswift.com
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...
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!
hackingwithswift.com
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...
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!
hackingwithswift.com
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
Hacking with Swift+
Subscribe to Hacking with Swift+ and get advanced Swift tutorials to help take your career to the next level.
hackingwithswift.com
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
Main landing page
Subscribe to the Kickstart newsletter, and grow your success on the App Store.
newsletter.kickstart.tools
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 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.
kickstart.tools
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 🤩
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...
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.
hackingwithswift.com
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/...
How to let users select pictures using PhotosPicker - a free SwiftUI by Example tutorial
Learn Swift coding for iOS with these free tutorials
hackingwithswift.com