High Level Anatomy of a Camera Capturing Session

I used the following tutorial series from Apple on ‘Capturing and Displaying Photos’. They’re great. Just that it took me a bit to be able to piece together how components from AVFoundation work together. Working with AVFoundation isn’t really the kind where you read documentation and then can piece things together. It’s complicated. You might understand an individual step, but won’t understand when it should be done. There’s just too many components and while it’s not low-level, it’s certainly a different kind of iOS....

What Is a Suspension Point In Swift?

A suspension point doesn’t mean the current thread is blocked. Nor it means the current actor is blocked. All it means is that the current task / function is blocked / suspended / waiting for an asynchronous task to finish. @MainActor func foo() async { doA() let b = await doB() doC() } When you get to doB(), then the MainActor / Main Thread are not suspended. Other tasks can be enqueued and executed on the main thread....

Live Activities Part 1 - Problem Statement

I recently went on a quest for Live Activities. There’s a ton of gotchas or subtle notes that aren’t clearly mentioned. Think of the series as an unofficial rfc. Intro Example app - wwdc code - docs confusion points I saw Apple’s videos and docs on ActivityKit. They do a decent job of showing you 80% of the API and how Live Activity works. The remaining 20% is an enigma though....

Live Activities Part 2 - The missing doc

How do I begin development for Live Activities? Follow Apple’s docs: Add a new† (widget) target to your app. Make sure you select ‘Live Activities’. Add the necessary plist items. Add push notification capability. Only needed if you want to start / update from server. If everything is done from within the app then you don’t need this. Example ‘Clock’ App on iPhone adds timers to your phone without any server interaction....

Live Activities Part 3 - Development

Development How can I share classes between widget and app? Models must be shared across targets. App needs the model to manage its lifecycle (start, update, end, handling dismissed / stale activities). Widget needs the model to be able to present it. Each View should only get added to targets that needs them. Your widget must create views based on the models for all Live Activity presentations. Your app may need views if it has an in-app view related to the live activity....

Live Activities Part 4 - Debugging

Debugging Notification delivery issues Can you send Live Activity notifications to simulator? Yes. The token created by the simulator works. Just don’t use the simulator for testing application lifecycle behavior or background tasks as a may not properly simulate OS restrictions. Can you drag and drop payloads into the simulator? That didn’t work for me. Timing of ‘Token Registration’ vs ‘Payload Sending’ Make sure the tokens are stored in your servers before sending the payload....

Live Activities Part 5 - The Update Token Problem

So your infrastructure and all is in place. But you have one problem. The OS isn’t issuing the ‘update token’ to you. This post walks you through when the problem occurs and when it doesn’t occur. Attempts I made to fix the issue, how I failed, how different use cases of Live Activity can have different out comes in terms of Completion Rate and final take. Problem ​WHEN ​When a Live Activity is started from the server, the OS doesn’t issue an update token until user locks the screen and then hits Allow....

paper on actor

Swift Actors: few random notes

This post isn’t meant to explain how actors work. Rather just elaborate a few tiny details. I’m often curious about the origins of things. How people met, dated or how they began their careers or founded their companies. Similarly about namings, understanding the context often gives you a foundational understanding. I give feedback in Pull Requests about variable and type names or seek advice through code-review channels. First time it occurred was when Michael Mayer at our Philly CocoaHeads (Pro Swift) Book club explained that the reduce function means “how you jam and reduce an entire array into a single value”....

Interviewing - Final Round Learnings

After going through a final-round interviews as a senior iOS engineer, I’ve learned that technical skills alone aren’t enough. The best candidates excel across multiple dimensions: system design thinking, behavioral storytelling, code review acumen, and interview presence. This post captures the hard-won lessons from my recent interview experiences—what worked, what didn’t, and what I’d do differently next time. These aren’t theoretical tips, but practical insights that came from real feedback and reflection....

Symmetric Tree

Leetcode considers this question to be easy, but it was a bit more complicated than that at first for me. Let’s try solving it three different ways: Whenever I can, I always try to do BFS. It seems much more natural. BFS - 1st solution func isSymmetricBFS(_ root: TreeNode?) -> Bool { var queue: [TreeNode?] = [] queue.append(root) while !queue.isEmpty { let temp = queue queue.removeAll() // 🔑 to make sure you don't expand on `nil` nodes — otherwise it would be endless for node in temp where node !...