Objective C Devs: How hard was it to switch to Swift?

3 tolarewaju3 4 5/16/2025, 3:21:01 PM
My app is written in objective c and has been for years. Obviously a lot of libraries are only being created in Swift. I know that eventually I'm going to have to change, but I'm curious as to how hard that was

Comments (4)

ben_w · 2h ago
Fairly easy. The language itself is an improvement, the hardest part was the correct use of ?, ??, and !, which isn't that hard.

Lots of the kind of mistake one can make in ObjC and only notice at runtime, get caught at compile time in swift.

The frameworks are more of a mess: SwiftUI is something I want to like, but mostly gets in the way. There's now too many different ways to do background tasks, all promising to solve everything.

But you can still use UIKit and GCD, and I prefer to when I can.

sherdil2022 · 3h ago
What is your app?

Swift is a breeze compared to Objective C. Instead of conversion, consider rewriting it from scratch using Swift.

tolarewaju3 · 3h ago
It's a real-world game to beat social anxiety called Roadmap. It's not super complex. Here are the main technologies I'm using.

AWS DynamoDB

AWS Cognito

AWS Lambda for AI calls

Cocoa Control libraries for showing players challenges, progress, and unlocks

OneSignal Push Notifs to notify players of changing game state

I know that all of these have Swift libraries or probably some similar ones. And I've written some swift code. But I'm just wondering about the syntax shift or other gotchas that I may not be thinking about. Even things like connecting to the storyboard seem like they might have minor differences

ben_w · 2h ago
Storyboard is probably the closest to a gotcha, because all the views have to be optionals, even though your code will never see them in a nil state. This is the only sensible case I've seen for swift to have implicitly unwrapped optionals (that's the ones declared with a !)