Live data from Hacker News

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

news.ycombinator.com

1–6 of 6 posts

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

#4

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

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

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

#5
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.

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

#6

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

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 swi…

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 !)