You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /// A dependency on a specific protocol's functionality.
  19. NS_SWIFT_NAME(Dependency)
  20. @interface FIRDependency : NSObject
  21. /// The protocol describing functionality being depended on.
  22. @property(nonatomic, strong, readonly) Protocol *protocol;
  23. /// A flag to specify if the dependency is required or not.
  24. @property(nonatomic, readonly) BOOL isRequired;
  25. /// Initializes a dependency that is required. Calls `initWithProtocol:isRequired` with `YES` for
  26. /// the required parameter.
  27. /// Creates a required dependency on the specified protocol's functionality.
  28. + (instancetype)dependencyWithProtocol:(Protocol *)protocol;
  29. /// Creates a dependency on the specified protocol's functionality and specify if it's required for
  30. /// the class's functionality.
  31. + (instancetype)dependencyWithProtocol:(Protocol *)protocol isRequired:(BOOL)required;
  32. /// Use `dependencyWithProtocol:isRequired:` instead.
  33. - (instancetype)init NS_UNAVAILABLE;
  34. @end
  35. NS_ASSUME_NONNULL_END