Latest 1.0.0
License MIT
Platforms ios 10.0

CI Status

DependencyManager provides simple interface for declaring weak dependencies. Weak means that dependencies will live in memory as long as some other part of app keep using it, and will autoreleased when it’s no longer needed, reducing memory footprint.

DepedencyManager itself provides ability to retrieve/create new services by keys using swift resolve<T>(key: String, creator: () -> (T)) function by unique key for services and creator block that should be called when services had to be recreated.

Generally it is recommended to describe public interface to intended services as Protocol then, then provide implementation as private class conforming to the protocol and in that same file declare extension to DependencyManagerProtocol to create specific implementation as the protocol:

 protocol FetchStringsServiceProtocol: PublicServicePorotocol {
    func fetchStrings(handler:  (([String]) -> () ) )

 extension DependencyManagerProtocol {
    func resolveFetchStringsService() -> FetchServiceProtocol {
        return self.resolve(key: "StringService") {

 private class StringServiceImp: FetchStringsServiceProtocol {

    func fetchStrings(handler:  (([String]) -> () ) ) {

Please see Expample for additional details.


To run the example project, clone the repo, and run pod install from the Example directory first.


Framework compliant with Swift4.2 and by so require XCode10.


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

pod 'DependencyManager'

Or via Carthage

github "Michael-Vorontsov/DependencyManager"


Michael Vorontsov, [email protected]


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

Latest podspec

    "name": "DependencyManager",
    "version": "1.0.0",
    "summary": "Simple DependencyManager.",
    "swift_version": "4.2",
    "description": "DependencyManager provides simple way to manage dependencies accors app,nInitialise it on demand in release if when no longer needed.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Michael Vorontsov": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "platforms": {
        "ios": "10.0"
    "source_files": "DependencyManager/Classes/**/*"

Pin It on Pinterest

Share This