FIRCLSFABAsyncOperation.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2019 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. /**
  16. * Completion block that can be called in your subclass implementation. It is up to you when you
  17. * want to call it.
  18. */
  19. typedef void (^FIRCLSFABAsyncOperationCompletionBlock)(NSError *__nullable error);
  20. /**
  21. * FIRCLSFABAsyncOperation is a subclass of NSOperation that allows for asynchronous work to be
  22. * performed, for things like networking, IPC or UI-driven logic. Create your own subclasses to
  23. * encapsulate custom logic.
  24. * @warning When subclassing to create your own operations, be sure to call -[finishWithError:] at
  25. * some point, or program execution will hang.
  26. * @see -[finishWithError:] in FIRCLSFABAsyncOperation_Private.h
  27. */
  28. @interface FIRCLSFABAsyncOperation : NSOperation
  29. /**
  30. * Add a callback method for consumers of your subclasses to set when the asynchronous work is
  31. * marked as complete with -[finishWithError:].
  32. */
  33. @property(copy, nonatomic, nullable) FIRCLSFABAsyncOperationCompletionBlock asyncCompletion;
  34. @end