Member-only story
Avoiding “Massive AppDelegates” in iOS
How to make order in AppDelegate
Introduction
I was writing about how to organise your iOS project. And got many questions to elaborate on how to avoid having “Massive AppDelegate”.
If you have already worked on a couple of projects, you have a high chance that you have encountered the “Massive ViewController” issue.
To resolve this you can use extension
to extract some logic, to use child view controller, or to use some architectural pattern like MVP, MVVM, VIPER, CleanVIP etc.
On the contrary, many organized projects still have huge AppDelegates
. In this article, I will try to present my favorite solution for this problem.
The Problem
Almost all the online 3rd party SDK Integration tutorials show their basic implementation and how to initialize them — like Firebase, Realm, AppFlyer, Alamofire etc. You integrate them and initialize them in AppDelegate
.
Then the Product Owner asks for new features based on the Push Notification, Location, CoreData, etc.
You add them also to AppDelegate
. At this point AppDelegate
application(_:didFinishLaunchingWithOptions:)
already have a bunch of code that logically should have some separation. And this…