Paul Hudson

@twostraws
11.7K Followers
120 Following
2.8K Posts
I write Swift and write about Swift, but most people prefer my dogs.
Pronounshe/him
Websitehackingwithswift.com
GitHubgithub.com/twostraws
For HWS+ subscribers: A few lines of Core Motion code and suddenly your SwiftUI views respond to how the device is held - screen-blended circles, spinning masks, and even 3D rotations. https://www.hackingwithswift.com/plus/swiftui-special-effects/controlling-views-using-the-accelerometer
Controlling views using the accelerometer – Hacking with Swift+

Reading device motion and orientation is a fast and slightly magical way to incorporate the real world into your apps, and can do a huge amount to add a little spark of delight to your UI. In this article I’m going to show you how easy it is to control SwiftUI layouts using the accelerometer, and give you a few ideas for special effects.

Hacking with Swift
Mark a SwiftData property with @transient and it stays in memory only, never written to disk. Two rules: it needs a default value, and you can't use it in predicates. 💾 https://www.hackingwithswift.com/quick-start/swiftdata/how-to-make-transient-attributes-in-a-swiftdata-model
How to make transient attributes in a SwiftData model - a free SwiftData by Example tutorial

Learn Swift coding for iOS with these free tutorials

Hacking with Swift
I think GitHub and I have very different definitions of "short and memorable." 🧐

#WWDC26 isn't far away, and I'm running two free events live in Cupertino, hosted by @CommunityKit:

- Workshop: Write Faster, Smarter Swift – https://luma.com/nvgsjp74
- What’s New in iOS 27 – https://luma.com/bwg9eoer

I am closing sign ups in a few days, and will issue tickets!

Workshop: Write Faster, Smarter Swift · Luma

In this workshop you'll learn how to use Apple's Swift packages to improve any kind of code. The result is code that's significantly simpler and significantly…

Repeating the same test setup across multiple suites? Swift Testing's TestScoping protocol lets you wrap environment config into a reusable trait and apply it with a single annotation. https://www.hackingwithswift.com/swift/6.1/swift-testing-test-scopes
Swift Testing: Test Scoping Traits – available from Swift 6.1

Swift Testing: Test Scoping Traits example code from Swift 6.1

Hacking with Swift
Sunday Build with HWS+: Calendar notifications are easy to miss, but alarms aren't. This app combines EventKit with AlarmKit to turn your events into unmissable alerts that sync to Apple Watch. #SundayBuild https://www.hackingwithswift.com/plus/live-streams/neverforget
NeverForget – Hacking with Swift+

In this stream we’ll build a trivial app that solves a real problem – my favorite kind of project! Even better, EventKit and AlarmKit do almost all the work for us…

Hacking with Swift

RE: https://mastodon.social/@CommunityKit/116448914899227818

One of the best CommunityKit events is back for another year, and all indie developers should come – we give you free space to show off your app to other developers, hand out (or collect!) swag, and get a whole range of ideas from others.

If you're in Cupertino for #WWDC26 week, you should come! Even better, show off your app too – you can still register for a spot!

With scrollTransition(), you can control opacity, scale, blur, and hue as views enter and leave the visible area of a scroll view. https://www.hackingwithswift.com/quick-start/swiftui/how-to-make-views-scroll-with-a-custom-transition
How to make views scroll with a custom transition - a free SwiftUI by Example tutorial

Learn Swift coding for iOS with these free tutorials

Hacking with Swift
SwiftData handles database creation, relationship management, view updates, and CloudKit sync - all without writing a single line of database code. Build a real app with it from scratch in this tutorial. https://www.hackingwithswift.com/articles/263/build-your-first-app-with-swiftui-and-swiftdata
Build your first app with SwiftUI and SwiftData

Learn about queries, models, containers, and more, all while building a real app.

Hacking with Swift
For HWS+ subscribers: Confetti, fire, smoke, rain, snow - all from one SwiftUI particle system you build from scratch. The best part is how many effects you can create just by tweaking a few parameters. https://www.hackingwithswift.com/plus/swiftui-special-effects/creating-a-particle-system-in-swiftui
Creating a particle system in SwiftUI – Hacking with Swift+

Particle systems let us create special effects such as confetti, fire, smoke, rain, and snow, all by adjusting a range of inputs. In this article we’re going to build our own particle system entirely driven by SwiftUI, so you can easily add some sparkle to your apps.

Hacking with Swift