profile

SwiftDifferently

iOS Engineer sharing weekly Swift tips that work in production, plus insights on personal growth and tech innovation. This newsletter is not just for iOS but for all the visionaries who dare to think differently - the ones who believe their code can change the world. 🌍

Subscribe to get all my latest posts

Actors in Swift: The Problem They Solve and How it Works

A couple of days ago, I wrote an article about AsyncGate, built by Matt—a way to solve actor rentrency. Writing it scratched an itch, but it also left me with a bigger question buzzing in the back of my head: what are actors actually for? How do they work under the hood? And why did Swift bother adding them in the first place? 🤔 So I did what any curious developer would do—I went straight to the source and read the actor proposal, SE-0306. And honestly? Best decision I’ve made in a while 😅....
READ POST

How Do You Build a Mutex That Works with async/await ?

A couple of days ago I ran into a really interesting use case: I wanted to protect a method from being called more than once at a time. You might think "actor, done" — but nope, an actor won't save you here. Because of actor reentrancy, the moment your method hits an await and suspends, another task can sneak in and start running the same method. Mutual exclusion across suspension points? Not guaranteed. The classic tool for "only one thing touches this at a time" is a Mutex — in general CS...
READ POST
How to check if a string is a full of spaces ?

How to check if a string is a full of spaces 🤔

Tip of the Day Recently, I had a problem where the user can skip a certain text filed after write only spaces in the text filed so I came up with this code to check if the string is only white space and at this point consider this as empty: From Community Identifying individual sounds in an audio file Why I avoid Group in swiftUI ModelActor is just weird Writing custom property wrappers for SwiftUI Unsubscribe · Preferences
READ POST

What is new is Swift 6.1 🤔

A Quick swift tip you can run any closure on the main thread by adding @MainActor attribute to it instead of using DispatchQueue.main : From the Community What is new in Swift 6.1 ? Secret SwiftUI: A practical use for _VariadicView Hardcore Debugging How to use FormatStyle to restrict TextField input in SwiftUI Unsubscribe · Preferences
READ POST
Generic ViewModel in swiftUI

Generic viewModel in SwiftUI. How ?🤔

In the last couple of months I was trying to add LockScreenCapture feature to my app MultiCam, it wasn't an easy takes at all and finally thank god submitted a new build today with the feature. Custom Control Widgets icon From it I learned a lot of things the first one is the fact that we can't use a custom image in the control widgets but if you want to add a custom shape for the control widget you need to create custom SF symbol (which wasn't an easy task for me as an engineer 😂). Generic...
READ POST
Omar Elsayed taking classes at The Cooking School

A Lesson in Patience: From Pasta to Life 🍝

This past week, I embarked on a new adventure - cooking classes! While I'll share more about how this decision ties into creativity in my next newsletter, today I want to focus on an unexpected lesson I learned while making fresh pasta. As I stood there learning to mix, knead, and shape the pasta dough, I discovered that the secret to excellent pasta isn't just in the ingredients - it's in the patience. Each step demands its own time: the careful mixing, the rhythmic kneading, and the precise...
READ POST
WWDC session about swift new concurrency

We can’t touch that code, it’s callback based

‘We can’t touch that code — it’s all callback-based!’ Sound familiar? As a developer, you’ve probably heard this countless times, or even said it yourself. Modern Concurrency promises cleaner more maintainable code with its elegant async/await syntax. Yet many teams find themselves stuck with legacy codebase, feeling like they’re forced to choose between modern development practices and stable working systems. But what if you didn’t have to choose? At Klivvr, we faced this exact challenge....
READ POST
Picture of Omar Elsayed learning swift and talks about the key to growth.

The Key to Growth 📈

When I was about to graduate from Electric Engineering in the last semester I decided to shift my career to be an iOS software engineer. I had no idea how to reach this goal and I wasn't sure if I will make it, the only thing I knew is that this is the one thing I am passionate about and want to spend my time doing. On 2 of February 2023, I started by first swift lesson where I have learned how to print "Hello, World" 😂. Picture of me writing my first swift code on 2 Feb 2023 Now after just 2...
READ POST