Advanced-NSOperations/Earthquakes/Operations/OperationObserver.swift
2022-02-16 22:16:09 -08:00

29 lines
861 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Copyright (C) 2015 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
This file defines the OperationObserver protocol.
*/
import Foundation
/**
The protocol that types may implement if they wish to be notified of significant
operation lifecycle events.
*/
protocol OperationObserver {
/// Invoked immediately prior to the `Operation`'s `execute()` method.
func operationDidStart(operation: Operation)
/// Invoked when `Operation.produceOperation(_:)` is executed.
func operation(operation: Operation, didProduceOperation newOperation: NSOperation)
/**
Invoked as an `Operation` finishes, along with any errors produced during
execution (or readiness evaluation).
*/
func operationDidFinish(operation: Operation, errors: [NSError])
}