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/...
Posts by Paul Hudson
🏗️ 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...
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...
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/...
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...
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...
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/...
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...
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...
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/...
It does!
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...
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...
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/...
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...
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...
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! 🙌
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...
I don’t see why not!
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...
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/...
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...
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...
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/...
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...
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...
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...
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/...
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...
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.