In this post, I’ll share the architecture, tools, code standards that we are using to get a better coding experience.
The Stack 📚:
- GitHub
- Swift 4.2
- CoreData
- MVVM
- R.Swift
- Dependency Manager
- Fastlane
- Firebase
- CI/CD: Github Action, Bitrise
- SwiftLint
- Swinject
- CodeStandard: Apple + Google
Github
We use Github for source control. Recently we have started using GitHub wiki pages for hosting our API payloads structure.
Xcode
Without Xcode, it’s nearly impossible to become an iOS Application engineer. We always ensure that the Xcode version is downloaded from the Mac Appstore rather than Google.
Never Ending Story: Every end of September we switch to the GM (golden master) version to prepare our app to support the new iOS version.
We try to avoid Xcode usage to solve Merge conflicts. Instead, we follow this approach to fixing conflicts: Open VSCode → Fix Conflicts → Push → Quit. ✌️App Architecture
App Architecture
Architecture and design patterns are always a hot topic for developers... Every architecture has its uniqueness. Choosing one among them is hard. We chose MVC, MVP, VIP, MVVM, and VIPER from that list.
We chose MVVM (Model–View–ViewModel) for its decoupling nature. Adding POP (protocol-oriented programming) to MVVM helps us to write more reusable components. Like water, we can derive many new combinations by mixing MVVM with others, such as:
- MVVM + POP
- MVVM + RxSwift
- MVVM + Swinject + RxSwift
- MVVM + SwiftUI
- MVVM + Combine + SwiftUI
UI
I am not going to deep dive much into UI, instead, I will share some tips that are useful for leveraging the development.
- Storyboards per feature
- StackViews
- FetchedResultController
- DiffableDataSource
- Kingfisher
- MBProgressHUD
Apart from the above, we create our UI libraries from being inspired by 3rd party libraries.
Coredata
A framework that never lets developers sleep 😔. More on upcoming articles.
For now, you can think of this as a persistent framework (in other words Database)
Dependency Manager
Currently, we are using CocoaPods as our dependency manager since it completes all our needs. We are gradually migrating towards SwiftPackageManager since it’s from Apple and supports bundles as well.
- Private Pods: All of our private dependency goes here.
- Public Pods: Mostly UI framework which can work independently will be hosted as public pods.
Fastlane
App automation is achieved using this tool.
Fastlane Match 🔑:
- Xcode Automatic Signing is tedious and messy., To avoid that we switched to Fastlane Match to manage code signing identities.
- It helps us to store your code signing identities and profiles in your own private, encrypted git repository to securely sync them across machines
- Once set up is done successfully, every developer can reproduce signed builds on any computer.
Fastlane Deployment 🚀:
- We have created our custom workflow to build, test, upload, and distribute new releases to the app store
- It is a one-click that runs everything.
Fastlane Integration:
- Our Fastlane is hooked up with the slack channel to get workflow status. We have installed the slack mobile app and signed into the channel to receive push notifications about the workflow status.
Firebase
We do use some of the firebase features for the following purpose:
- Firebase/RemoteConfig: Feature Flagging
- Firebase/Performance: To get to know more about app startup time and API performance with analytics.
- Firebase/Messaging: for push notifications
- Firebase/Crashlytics: for application crash reports
- Firebase/DynamicLinks: for universal linking.
We keep visiting firebase release notes to get to know more about their fixes and releases.
SwiftLint
When we work as a team, each one will have their taste in writing code. We need to enforce everyone to use one common standard. We have employed swiftlint in place as a common standard. Additionally, we got inspired by FAANG code standards and took some of their rules into our swiftlint yaml rules.
If you wish to integrate swiftlint into your project, please follow this:
Bitrise
After so many attempts with Jenkins, buddybuild, Github actions, we ended up choosing Bitrise as our CI/CD tool. It makes our work much easier. Bitrise has a visual configuration editor in its web app which makes the whole step easier. Each step is represented as one block in the editor. This feature helps you to edit configuration files directly with one click.
You can find CI/CD tools reviews and discussions here. https://instabug.com/blog/continuous-integration-tools/
Knowledge Base
We keep ourselves updated with market standards by following these.
- iOS Developer Keynotes (Not only the first keynote that Tim does)
- iOSGoodies
- iOSGists
- Reading StackOverflow Comments (not only answers)
- Subscribing selected newsletters.
- Following these people on Twitter, Medium, sometimes annoying them by asking queries.
- And finally, Undoubtedly Reading/Stealing 3rd party frameworks in the name of inspiration 😎.
“Be the senior engineer you needed as a junior.” — Someone
Thank you for reading the post, leave a comment with tools that you use to make your development better ✌️.