For a new app I'm working on, I needed to display a measurement in a SwiftUI Text view with the unit in a smaller font than the value. We can do this by targeting the unit component in an AttributedString. I shared an example on my blog:
https://t.co/wYRlHeYM6R
The Redacted View Modifier is great, but I always disliked the readability of placeholder copy. We can improve readability by using a few custom extensions.
https://t.co/eJ5zBOvTut
#swiftlang#iosdev
Le Prophète ﷺ a dit:
« Les deux unités de prière du fajr sont meilleures que la vie d’ici-bas et ce qui s’y trouve »
Rapporté par Muslim dans son Sahih n°725
Controlling Xcode's Simulator using 63% less tokens while being 19% faster.
That's a bold statement.
Here's how we did our research:
https://t.co/52VkdHADRm
#swiftlang#iosdev
Swift Concurrency is the most powerful paradigm in the language. Consequently, it’s also really bloody hard to learn. Not only are there dozens of keywords and APIs to learn; there are also some weird behaviours that can throw you off big-time. These unintuitive behaviours introduce footguns and WTFs-per-minute which act like Lego on the carpet of your barefoot learning journey.
There are logical design decisions behind the unintuitive behaviour. Understanding these decisions builds up your own mental model. Your mental model codifies the obscure and brings enlightenment: an intuition for the unintuitive.
Today we'll be going over:
* Actor context inheritance in Tasks (and how it works under the hood)
* Task hierarchy & the cascading cancellation misconception
* Actor re-entrancy & interleaving, plus a very controversial question
* Swift 6.2 Approachable Concurrency™ turning everything on its head again
If you really want to cement your understanding of the gotchas, the best thing you can do is play with some code, add breakpoints, and inspect the thread debugger to see what’s physically happening. Fortunately for you, I also added a comprehensive open-source demo project to demonstrates each of these gotchas.
I wrote about the most context inheritance, cascading cancellation, interleaving, and Swift 6.2 in Swift Concurrency's Biggest Unintuitive Gotchas 👽 https://t.co/WXjwHwblRE
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://t.co/FkG9gGXVtu
SwiftUI Performance Tuning just got easier: let your agents do it using this Agent Skill update by @polpielladev.
Curated in this week's #swiftleeweekly https://t.co/8BzoGR9TAy
The creator of Claude Code teaches more about vibe-coding in 30 minutes than most tutorials do in hours.
Save this — it'll change how you build forever.
SwiftUI Agent Skill 3.0.0 just released!
It can now parse xctrace data from Time Profiler, hangs, animation hitches, and SwiftUI traces, correlate issues with main-thread samples, and turn the whole firehose into JSON + Markdown an agent can actually reason about.
Huge credit to @polpielladev for shipping the parser 🙌
Ready to make your SwiftUI app faster?
`withTaskGroup` and `withThrowingTaskGroup` are probably the most powerful tools in Swift Concurrency, unlocking massive parallelism in your code.
Task Groups allow us to spin off any number of async functions in parallel and collect the results together, provided they return the same type.
Learn advanced Swift Concurrency on my blog 🚀 https://t.co/TavplWgtKS
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 🔍 https://t.co/nMHccKE4Hj
Many folks avoid actors due to a proliferation of “awaits” that can introduce subtle race conditions as multiple threads can interleave and access the actor’s data.
But did you know you can squash many “awaits” down to a single one, eliminating race conditions in the process?
Tasks in Swift Concurrency are very similar to NSThreads! Both help manage processes, but live at different levels of abstraction.
NSThread is an operating-system-level entity managed by the kernel. Each thread is a 512kB behemoth with its own call stack, making it expensive to context-switch between threads. The OS has to pause a thread, store its call stack somewhere safe, and resume it later. This overhead adds up in concurrent applications.
Tasks are Swift Concurrency’s lightweight “unit of execution”. They are managed by the Swift Runtime and are scheduled on the Cooperative Thread Pool, which itself aims to maintain 1 thread per core. Asynchronous work on tasks store context in continuations, a.k.a. async frames, and they are designed to yield execution to avoid deadlock and blocking.
Read my full blog post here: https://t.co/yGDBGdDdUO
SwiftUI Tip 💡
Use privacySensitive() to mark content as sensitive, such as API keys.
Then use .redacted(reason: .privacy) to show the redacted version.
→ https://t.co/l0YMqzafRl