No Description

FIRDependency.m 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "Private/FIRDependency.h"
  17. @interface FIRDependency ()
  18. - (instancetype)initWithProtocol:(Protocol *)protocol isRequired:(BOOL)required;
  19. @end
  20. @implementation FIRDependency
  21. + (instancetype)dependencyWithProtocol:(Protocol *)protocol {
  22. return [[self alloc] initWithProtocol:protocol isRequired:YES];
  23. }
  24. + (instancetype)dependencyWithProtocol:(Protocol *)protocol isRequired:(BOOL)required {
  25. return [[self alloc] initWithProtocol:protocol isRequired:required];
  26. }
  27. - (instancetype)initWithProtocol:(Protocol *)protocol isRequired:(BOOL)required {
  28. self = [super init];
  29. if (self) {
  30. _protocol = protocol;
  31. _isRequired = required;
  32. }
  33. return self;
  34. }
  35. @end