Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

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

Description

@dreamume

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions