Latest 1.0.0
Homepage https://github.com/altece/Aggregate
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Authors

Aggregate is an object which can compose protocol implementations from various objects
This can be useful for dividing large protocol implementations into separate objects,
and then combining them here to pass to a client as a single delegate, data source, or object.

import Aggregate

@objc protocol Foo {
    func doThis()
}

@objc protocol Bar {
    func doThat()
}

@objc EagerBeaver: NSObject, Foo {
    func doThis() {
        print("I did this!")
    }
}

@objc Underachiever: NSObject, Foo, Bar {
    func doThis() {
        print("Do I have to do this?")
    }

    func doThat() {
        print("Do I have to do that?")
    }
}

let averageJoe = Aggregate(of: [EagerBeaver(), Underachiever()]) as! Foo & Bar

averageJoe.doThis() // prints "I did this!"
averageJoe.doThat() // prints "Do I have to do that?"

It is important to note that the order of objects in the targets array denotes the calling
order for composed objects with duplicate method implementations, where the first target
has the highest prioritization. This is why Underachiever‘s doThis implementation wasn’t
called in the previous example.

Latest podspec

{
    "name": "Aggregate",
    "version": "1.0.0",
    "summary": "An aggregating object which can compose protocol implementations from various objects.",
    "description": "An aggregating object which can compose protocol implementations from various objectsnThis can be useful for dividing large protocol implementations into separate objects,nand then combining them here to pass to a client as a single delegate, data source, or object.",
    "homepage": "https://github.com/altece/Aggregate",
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    },
    "authors": {
        "Steven Brunwasser": ""
    },
    "source": {
        "git": "https://github.com/altece/Aggregate.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source_files": "Aggregate/**/*.{h,m,swift}",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This