Last active
June 13, 2021 18:26
-
-
Save V8tr/8c3803be69b8ba3bccffab377cf51c7e to your computer and use it in GitHub Desktop.
Refactoring Massive App Delegate using Composite pattern. See blog post for more details: https://www.vadimbulavin.com/refactoring-massive-app-delegate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PushNotificationsAppDelegate: AppDelegateType { | |
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { | |
// Registered successfully | |
} | |
} | |
class StartupConfiguratorAppDelegate: AppDelegateType { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Perform startup configurations, e.g. build UI stack, setup UIApperance | |
return true | |
} | |
} | |
class ThirdPartiesConfiguratorAppDelegate: AppDelegateType { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Setup third parties | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment