Author: Seren
A developer exploring iOS, Objective-C, Swift, and other tech stacks. Here to document my learning process, pitfalls, and growing journey across new technologies.
Non-intrusive Function Insertion Based on Runtime
By Seren |
04 Sep, 2026
Leave a comment
Method Swizzling is often called Objective-C black magic, but in practice it is a precise engineering tool — when your product manager asks you to add tracking to 50 ViewControllers without touching any existing code. The product manager’s requirement: every page appearance needed to report data. Adding code to each Controller one by one would […]
Dynamically Creating Classes and Assigning Properties at Runtime
By Seren |
03 Sep, 2026
Leave a comment
Objective-C Runtime lets you create classes entirely at runtime — a capability that powers KVO, Core Data, and many other framework internals that most developers take for granted. The ability to dynamically create classes at runtime is more practical than I’d ever imagined. Why We Need Dynamic Class Creation In conventional development, we define classes […]
Block Internal Function Pointer Structure Parsing
By Seren |
02 Sep, 2026
Leave a comment
Every Block you write is actually a full C struct hiding behind a simple syntax. Understanding this struct — its fields, offsets, and memory layout — is the key to debugging Block-related crashes. It wasn’t until I was debugging a crash and saw __block_invoke everywhere in the stack trace that I realized Blocks are far […]
Block Modify Local Variable Core Implementation Logic
By Seren |
01 Sep, 2026
Leave a comment
Why does adding __block to a variable inside a Block suddenly allow modification? The answer involves a hidden pointer redirect that most tutorials gloss over. The answer lies in Block’s variable capture mechanism and the underlying data structure of __block. The Phenomenon: What Happens Without __block Here’s some basic code: num was 100 when the […]
Objective-C Tagged Pointers Explained: Why Some Objects Never Reach the Heap
By Seren |
30 Aug, 2026
Leave a comment
I ran into tagged pointers through an allocation mystery. A test loop created thousands of boxed numbers, but Instruments showed far fewer heap allocations than I expected. At first I assumed the optimizer had removed my code. The values were definitely being consumed, though, and the count still looked “wrong.” Logging a few object addresses […]
KVO’s Hidden Subclass: How isa-Swizzling Changes Objective-C Objects at Runtime
By Seren |
29 Aug, 2026
Leave a comment
I first noticed KVO’s hidden subclass while debugging a setter breakpoint. The object printed as Person, but the call stack showed a class name I had never created. For a few minutes I wondered whether another library had swizzled the model behind my back. Printing both [object class] and object_getClass(object) before and after adding the […]
Checked Continuations in Swift: Bridging Callback APIs Without Leaks or Double Resumes
By Seren |
28 Aug, 2026
Leave a comment
My first continuation wrapper was only six lines long, and I was rather proud of it. A callback came in, I called resume, and an awkward legacy API suddenly worked with async/await. Then a cancellation test sat waiting until the test timeout. The callback API had a branch that returned without calling its completion handler. […]
Swift Sendable and @unchecked Sendable: A Practical Safety Checklist for Strict Concurrency
By Seren |
27 Aug, 2026
Leave a comment
When I enabled stricter concurrency checking on an older Swift target, the warning list was long enough to be discouraging. Several types had crossed queues for years without an obvious crash, so adding @unchecked Sendable everywhere looked like the fastest way forward. I tried it on one wrapper and immediately disliked how quiet the compiler […]
Swift Actor Reentrancy Explained: Why Protected State Can Still Become Stale
By Seren |
26 Aug, 2026
Leave a comment
The first time actor reentrancy really clicked for me, I was looking at two identical token-refresh requests in the network log. I had moved the token store into an actor, the compiler was happy, and I was convinced duplicate refreshes were no longer possible. Yet there they were, starting only milliseconds apart. My first reaction […]
Swift Task Cancellation in Practice: Stopping Stale Requests Before They Update the UI
By Seren |
25 Aug, 2026
Leave a comment
I finally took task cancellation seriously after watching a search screen display the wrong result with perfectly valid network responses. I typed “sw,” paused briefly, and then completed the word “swift.” The second request finished first and the UI looked correct for a moment. Then the slower “sw” request returned and replaced the screen with […]
