There is a line (I think from Uncle Bob) that the biggest improvements in software engineering have come from limiting developers. Removing the GoTo, etc. I wonder how the AI game will play out in this respect. Not well in many cases.
@azamsharp Research is one of the best uses of AI. Being able to track and print out a call stack is so useful, especially when there are jumps like notifications.
`AppStore.sync()` is not the Restore Purchases API you should be using.
It looks like it is. It isn't.
The right call:
`for await result in Transaction.currentEntitlements`
Instant. Silent. No password prompt. Covers 90%.
Fallback `to sync()`
youtu.be/EPJAW4AZamY
🚨Stop storing premium state in UserDefaults.
Use Transaction.currentEntitlements.
One is device-bound. One is Apple-ID-bound.
Apple Review only cares about one of them.
Heres which: youtu.be/EPJAW4AZamY
App Review doesnt find obscure bugs in your IAP code.
They delete your app. Reinstall. Tap Restore.
If your UserDefaults flag wiped → 3.1.1 rejection on autopilot.
Thats the entire test. Thirty seconds to rejection.
youtu.be/EPJAW4AZamY
You've shipped Strategy Pattern code. You probably didn't know.
If you've ever written `decoder.keyDecodingStrategy = .convertFromSnakeCase` — that's it. Apple named it Strategy on purpose.
Strategy isn't just a GoF book chapter. It's a working pattern Apple shipped in:
• JSONDecoder.KeyDecodingStrategy
• JSONDecoder.DateDecodingStrategy
• NumberFormatter.Style
• DateFormatter.Style
• Sequence.sorted(by:)
Each one swaps an algorithm by handing one in.
The mental model: a delegate is a protocol that hands off behavior. UITableViewDelegate hands off ~30 things — selection, height, swipe actions. A Strategy hands off ONE thing.
Strategy = a single-method delegate.
Two valid Swift forms:
1. Closure on the enum case — idiomatic, ergonomic
2. Protocol + one struct per strategy — extensible, testable in isolation
Pick #1 for ergonomics. Pick #2 when you need extension from outside the module. Both kill the multi-case switch.
The trigger to deploy it: extension. A switch that will grow new cases wants Strategy. A switch that will never grow is fine. Don't reach for it as ceremony.
Full walkthrough — including a real refactor from a shipping iOS app:
youtu.be/Chh7wyGUtYs
A refactor is just a shuffling of code.
But it's a shuffling that makes the code base better. Boy Scout motto: leave it better than you found it.
That's why Strategy beats nested switches — same data, just lives next to the case it belongs to.
The cleanest definition of the Strategy Pattern I've found:
"A delegate that does one job."
If you understand UITableViewDelegate, you already understand Strategy. Same machinery, narrower scope.
Full breakdown: youtu.be/Chh7wyGUtYs
Apple literally named these:
• JSONDecoder.KeyDecodingStrategy
• NumberFormatter.Style
• DateFormatter.Style
These ARE the Strategy Pattern.
If you've used any of them, you've already shipped Strategy code. You just didn't know the name.
youtu.be/Chh7wyGUtYs
@azamsharp One of my favorite examples of this was in a personal project. I'd been working with Claude at changing some behavior. Was reviewing the code and noticed 4 variables with similar names. I re-prompted asking if they were all necessary (I knew it could be done with one). 🙄
@azamsharp This makes a certain amount of sense. Good system design is a top tier skill. Few really posses it. There for, there would be much less training data on it.
@dhh I love this. I remember when I started college (2003). I first had a PC, but found setting up the dev environment unpleasant. Then I got a mac and loved how easy it was.
2K Followers 4 FollowingMobile and Web Development | iOS and macOS | Swift | SwiftUI | Server Development | Python | Founded by @natpanferova and @hishnash
719K Followers 198 FollowingFather of three, Creator of Ruby on Rails + Omarchy, Co-owner & CTO of 37signals, Shopify director, NYT best-selling author, and Le Mans 24h class-winner.
11K Followers 1K FollowingHudson’s and Oaklyn’s dad 👨👩👧👦 Monetization EM at @RevenueCat 💼 Lead maintainer of @FastlaneTools 🚀@DeepDishSwift 🍕 https://t.co/3b56M3Oqgv
30K Followers 846 FollowingThe cause of several bugs since iOS 4.
----
Words: https://t.co/SZiXGiq5jt
Alyx: https://t.co/2TZlcoGGED
Bball: @elitehoopsapp
Dev Rel: @Superwall
68K Followers 1K FollowingSimplifying science. Deep dives weekly where I explain phenomena in physics, biology, math, chemistry. Home of Scientist Sunday🤓
2.6M Followers 29 FollowingFrequently updated assortment of tweets related to the world of science (with some side tracking) - As an Amazon Associate we earn from qualifying purchases
2.5M Followers 42 Following"The most beautiful thing we can experience is the mysterious. It is the source of all true art and science." - Albert Einstein
4.3M Followers 171 FollowingEngineer. Selecting and curating pictures and videos trying to awaken your sense of wonder since 2014. Science, tech, art, weather, space, the unusual around us
79K Followers 0 FollowingSwift is a general-purpose programming language that's fast, modern, safe, and a joy to write. Designed for all, developed in the open.
19K Followers 156 FollowingMaking your devices go brrr with https://t.co/jWbWzbxrJE 📳
Bringing festive lights to your devices with https://t.co/9iFbwJmTRI 🎄
Espresso lover ☕ and beer snob 🍻