Diving into an old project

Hey guys,

So I learnt Swift with UIKit in the last few days and it is pretty interesting. Then I decided to dive into my company’s iOS project since it needs some bug fixes and has some feature request.

But I noticed that it is a pretty old project, the last commit is from 2018. And it does not look similar to what I’ve learnt in the course. There are no storyboards. The UI is written programmatically and it looks pretty strange. I think it’s done that way because we needed many customizations but I feel that could have done using storyboards as well. There are some frameworks used like Carthage for managing external dependencies and other stuff too.

So I have a few questions:

Where and how can I learn writing UI programmatically, also writing AutoLayout constraints programmatically?
What is the best approach to manage external dependencies?
Are there any opensource projects which define the best approach for iOS development?
Should I rewrite the UI using storyboard?
What’s the future of SwiftUI, when should be the appropriate time to start shifting everything on SwiftUI. Is it production-ready?
What should be the next steps in my iOS journey?

I’m kind of overwhelmed by seeing the existing codebase which does not look familiar that’s why all these questions.

I’d really appreciate if somebody can answer these or maybe direct me to the relevant resources.

Thank you.

Welcome to the community Parag!

Where and how can I learn writing UI programmatically, also writing AutoLayout constraints programmatically?

Chris has a tutorial series on CWC+ if you are interested! Otherwise this is a great intro to programmatic UI.

What is the best approach to manage external dependencies?

This depends. Using Carthage is fine. The "recommended way now days is using SPM, Swift Package Manager. The most important part is that your dependencies are still kept up to date and aren’t old and not maintained anymore. Usually seeing commits in the last few months is good.

Are there any opensource projects which define the best approach for iOS development?

In what regards? Architecture? Security? Can you be more specific?

Should I rewrite the UI using storyboard?

No I’d recommend against this. Programmatic UI is very good when working in teams. Storyboards easily creates merge conflicts because the .storyboard file is really XML that’s compiled. With programmatic UI you know EXACTLY what constraints are where.

What’s the future of SwiftUI, when should be the appropriate time to start shifting everything on SwiftUI. Is it production-ready?

This depends on the functionality of your project. SwiftUI can handle some functions really well, others are still clunky. What does your app do?

What should be the next steps in my iOS journey?

What are your goals within iOS development? Do you already work as an iOS developer or are you doing something else and then learning iOS/Swift on the side in hopes to switch to iOS?
Either way I think you should learn UIKit with programmatic UI. To complete the app you have at your company.

Also yes you can easily do some things in storyboards vs programmatic, but it all depends on the app, it’s functionality, the team, etc. I do not think you should rewrite it, it doesn’t seem worth it, to me.

Hey Mikaela, thank you so much for such a descriptive answer.

I’ve already subscribed to CWC+, just missed the programmatic UI course. Will check that out today. Thank you.

Yes, in regards to architecture. So any opensource project where I can learn the best architecture available for iOS.

Our app mostly used for collecting research data, managing cases, and getting real-time reports. You can check here for more. Thank you.

There are some aspects that are complicated than it seems, such as we need these data forms to be dynamic and which depends on our CustomCondition’s Engine which is pretty complex. Though SwiftUI seems easy and powerful but I’m not sure if it can handle this kind of complex logic at this stage. What do you think? Can I use a combination of both UIKit and SwiftUI in a single project? And is it recomended?

I’m a native Android Developer and have 3 years of experience in the same field. Now I want to learn iOS development as well. And what I’ve learned in the past week, it seems a lot of fun. I’m enjoying it.

The question is should I focus more on UIKit or SwiftUI? Or both? I’ve already learned the basics of both from CWC+ courses. So now what should be my next steps to become the best iOS developer?

Thank you again.

Parag, the best architecture depends on the app. MVC will be fine for most applications, but MVVM is also popular.

I think it could be possible to do some features with SwiftUI. Swift is still the programming language, the UI part haha renders UI. Overall I’d say it looks like it’d be fine to do some parts in SwiftUI. But considering you’re newer to iOS and still learning, while also going into an existing codebase I’d leave it as is for right now and upgrade to SwiftUI later.

That also answers your next question, yes SwiftUI and UIKit can exist in the same project. This is often needed, depending on the app because of SwiftUI’s current limitations. It’s totally fine. It really depends on your user base, SwiftUI is iOS 13+ ONLY. If you have any iOS 12 users you can’t use SwiftUI, or will need to drop those users.

I think the next steps for you should be learning UIKit because you will need to work with it for existing projects. That’s not to say you can’t dabble in SwiftUI on the side. But to be in the job market right now you MUST know UIKit

1 Like

Pls I need help on this. Thanks

@Ogbworld

What version of Xcode are you using and what version of macOs do you have?

You will probably have to use:

let leftNumber = arc4random_uniform(13) + 1 
let rightNumber = arc4random_uniform(13) + 1 

Each will give you a number between 1 and 13 which matches the cards

1 Like

Did the programmatic UI course as you suggested. And already solved a couple of bugs in our company’s iOS app.

Thank you for describing everything so well.

1 Like