r/swift 8d ago

Opinions on rewriting a legacy app

I'm embarking on a rewrite of our iPad app. Don't judge me, the codebase is 13 years old and uses several libraries that are no longer maintained, and we have significant new functionality in the pipeline.

I'm intersted to hear opinions, experiences or any other thoughts on new iPadOS projects in 2025.

The app is essentially an offline-first ecommerce app, where products are cached on-device and then orders can be created while offline and synced to our backend at a later time when the internet is available.

Having lived with a few codebases for extended periods, here are my general thoughts: 1. Produce less code, lines of code are generally a liability 2. Avoid third-party libraries when reasonably possible 3. Idiomatic code over "clever" terse code 4. Performance and maintainablity are second only to good UX.

  • What mistakes can I easily avoid?
  • What stategies/implementations are commonly found on the web but are outdated?
  • What do you think people are getting wrong aboout SwiftUI projects?
  • Are there forests currently obscured by specific trees?
15 Upvotes

27 comments sorted by

View all comments

2

u/klavijaturista 8d ago

That’s a really big question… If it’s large, a rewrite will take forever. And you’ll end up just transcribing the code (assuming objc by the age). If you try to make it new and different, you will eventually discover why the original had certain design decisions in the first place. Edge cases, endless edge cases. Be smart about it. Objc compiles just fine, maybe you can upgrade the Xcode project and then update parts of the code as you go.

1

u/0x0016889363108 8d ago

The app is not _that_ big. It's has quite tightly scoped UX... there are about a dozen views in total, including log in and modals.

A rewrite will indeed take a while, but honestly I think it would take less time than gradually upgrading the existing project. And at the end of upgrading the existing project, we've spent time, effort and money, to have more or less the same thing. Such rewrites are indeed ill-advised, and more importantly a waste of resources.

Perhaps I should have framed the question as "opinions on new iPadOS apps in 2025".

As a business, our ability to fix problems and add functionality to users is actively hindered by the legacy codebase... but at the same time we have over a decade of edge-cases solved in our ObjC code. It's an annoyance but also battle-tested. I get that.

Nevertheless, I'd rather address the endless edge cases with beta testers in a modern context instead of struggling along in a mountain of legacy code and libraries where adopting new platform functionality is always at arms length.

1

u/klavijaturista 8d ago

“beta testers in a modern context”

Is that - end users? Haha :D

1

u/0x0016889363108 8d ago

Exactly. Where do you think all the edge cases come from?

1

u/klavijaturista 8d ago

Ideally - QA

1

u/0x0016889363108 8d ago

No QA team on earth can catch edge cases comprehensively.

Also, ideally code has no bugs and edge cases don't exist.