Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not use extension to make default implementation for OperationObserver protocol? #80

Open
dreamume opened this issue Oct 24, 2016 · 1 comment

Comments

@dreamume
Copy link

dreamume commented Oct 24, 2016

Hey,

Sometimes I use OperationObserver protocol, but I only want to do something in operationDidFinish func. I must also implement the other 3 funcs, too.

If I add bellow extension, I can only implement operationDidFinish function only!

public extension OperationObserver {
    func operationDidStart(operation: Operation) {
    }

    func operationDidCancel(operation: Operation) {
    }

    func operation(operation: Operation, didProduceOperation newOperation: NSOperation) {
    }

    func operationDidFinish(operation: Operation, errors: [NSError]) {
    }
}

So I think It will make OperationObserver protocol more friendly to use.

@mcmurrym
Copy link
Contributor

I would recommend creating a DidFinishOperationObserver implementation of OperationObserver. if you feel it should be added to PSOperations, you should submit a pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants