Latest 1.0.1
Homepage https://github.com/nikita-leonov/NLServiceLocator
License MIT
Frameworks Foundation
Authors

Service Locator for Objective C

Overview

Implementation of Service Locator design pattern for Objective C.

Usage

Register your service for protocol(s) implicitly or explicitly:

[NLServiceLocator registerService:myService];
[NLServiceLocator registerService:myService forProtocol:@protocol(NLSampleService)];

Retrieve services later when you need them by referencing protocol that it conforms and was used for implicit or explicit registration:

id<NLSampleService> myService = [NLServiceLocator serviceForProtocol:@protocol(NLSampleService)];

Done. Enjoy your nicely developed, loosely coupled architecture with an opportunity to replace service by its alternatives in a runtime. Just use it to make your code more managable, or simplify testing by providing mock services with couple of code lines.

Installation

pod "NLServiceLocator"

License

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

Latest podspec

{
    "name": "NLServiceLocator",
    "version": "1.0.1",
    "summary": "Implementation of Service Locator design pattern for Objective C. ",
    "description": "                    Implementation of Service Locator design pattern that allows implicitly or explicitly register services with use of protocols and retrieve them later with use of the same protocols.n",
    "license": "MIT",
    "homepage": "https://github.com/nikita-leonov/NLServiceLocator",
    "authors": {
        "Nikita Leonov": "[email protected]"
    },
    "social_media_url": "http://twitter.com/leonovco",
    "source": {
        "git": "https://github.com/nikita-leonov/NLServiceLocator.git",
        "tag": "1.0.1"
    },
    "source_files": "ServiceLocator/*.{h,m}",
    "frameworks": "Foundation",
    "requires_arc": true
}

Pin It on Pinterest

Share This