Latest 1.0.1
Homepage https://github.com/hartlco/AppDelegateComponent
License MIT
Platforms ios 8.0
Authors

Build Status
Version
License
Platform

A micro-framework helping you modularize and declutter your AppDelegate by splitting the functionality into testable components. The components get the AppDelegatecallbacks forwarded for implementing decoupled functionality.
AppDelegateComponent consists of 3 parts:

AppDelegateComponent

The protocol AppDelegateComponent defines functions from UIApplicationDelegate. Your types conforming to AppDelegateComponent can implement the callbacks it needs to provide the wanted functionality. For example registering a crash-logging framework in func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool.

AppDelegateComponentStore

The protocol AppDelegateComponentStore defines an array of AppDelegateComponent. They represent all available components that should receive the forwarded AppDelegate callbacks. One obvious candidate to conform to AppDelegateComponentStore is your AppDelegate.

AppDelegateComponentRunner

AppDelegateComponentRunner objects act as the glue between the App’s AppDelegate and all AppDelegateComponent provided by the AppDelegateComponentStore. The runner forwards all the callbacks.

See AppDelegate.swift for a practical example.

This project currently only supports the most common UIApplicationDelegate callbacks, or what was needed for Icro. Please feel free to open a pull-request to extend it.

Requirements

Installation

AppDelegateComponent is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'AppDelegateComponent'

Author

hartlco, [email protected]

License

AppDelegateComponent is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "AppDelegateComponent",
    "version": "1.0.1",
    "summary": "Split functionality in AppDelegate into smaller components",
    "description": "Provides a easy way to split functionality used in AppDelegate callbacks into small components",
    "homepage": "https://github.com/hartlco/AppDelegateComponent",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "hartlco": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hartlco/AppDelegateComponent.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/hartlco",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AppDelegateComponent/Classes/**/*",
    "swift_versions": "5.0",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This