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.

82 lines
2.3 KiB

6 years ago
  1. //
  2. // Fabric.h
  3. // Fabric
  4. //
  5. // Copyright (C) 2015 Twitter, Inc.
  6. //
  7. // Licensed under the Apache License, Version 2.0 (the "License");
  8. // you may not use this file except in compliance with the License.
  9. // You may obtain a copy of the License at
  10. //
  11. // http://www.apache.org/licenses/LICENSE-2.0
  12. //
  13. // Unless required by applicable law or agreed to in writing, software
  14. // distributed under the License is distributed on an "AS IS" BASIS,
  15. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. // See the License for the specific language governing permissions and
  17. // limitations under the License.
  18. //
  19. #import <Foundation/Foundation.h>
  20. #import "FABAttributes.h"
  21. NS_ASSUME_NONNULL_BEGIN
  22. #if TARGET_OS_IPHONE
  23. #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000
  24. #error "Fabric's minimum iOS version is 6.0"
  25. #endif
  26. #else
  27. #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
  28. #error "Fabric's minimum OS X version is 10.7"
  29. #endif
  30. #endif
  31. /**
  32. * Fabric Base. Coordinates configuration and starts all provided kits.
  33. */
  34. @interface Fabric : NSObject
  35. /**
  36. * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use.
  37. *
  38. * For example, in Objective-C:
  39. *
  40. * `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];`
  41. *
  42. * Swift:
  43. *
  44. * `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])`
  45. *
  46. * Only the first call to this method is honored. Subsequent calls are no-ops.
  47. *
  48. * @param kitClasses An array of kit Class objects
  49. *
  50. * @return Returns the shared Fabric instance. In most cases this can be ignored.
  51. */
  52. + (instancetype)with:(NSArray *)kitClasses;
  53. /**
  54. * Returns the Fabric singleton object.
  55. */
  56. + (instancetype)sharedSDK;
  57. /**
  58. * This BOOL enables or disables debug logging, such as kit version information. The default value is NO.
  59. */
  60. @property (nonatomic, assign) BOOL debug;
  61. /**
  62. * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance.
  63. */
  64. - (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance.");
  65. /**
  66. * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance.
  67. */
  68. + (instancetype)new FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance.");
  69. @end
  70. NS_ASSUME_NONNULL_END