| 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 | |
| 20 | #import <Foundation/Foundation.h> |
| 21 | #import "FABAttributes.h" |
| 22 | |
| 23 | NS_ASSUME_NONNULL_BEGIN |
| 24 | |
| 25 | #if TARGET_OS_IPHONE |
| 26 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 |
| 27 | #error "Fabric's minimum iOS version is 6.0" |
| 28 | #endif |
| 29 | #else |
| 30 | #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 |
| 31 | #error "Fabric's minimum OS X version is 10.7" |
| 32 | #endif |
| 33 | #endif |
| 34 | |
| 35 | /** |
| 36 | * Fabric Base. Coordinates configuration and starts all provided kits. |
| 37 | */ |
| 38 | @interface Fabric : NSObject |
| 39 | |
| 40 | /** |
| 41 | * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. |
| 42 | * |
| 43 | * For example, in Objective-C: |
| 44 | * |
| 45 | * `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];` |
| 46 | * |
| 47 | * Swift: |
| 48 | * |
| 49 | * `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])` |
| 50 | * |
| 51 | * Only the first call to this method is honored. Subsequent calls are no-ops. |
| 52 | * |
| 53 | * @param kitClasses An array of kit Class objects |
| 54 | * |
| 55 | * @return Returns the shared Fabric instance. In most cases this can be ignored. |
| 56 | */ |
| 57 | + (instancetype)with:(NSArray *)kitClasses; |
| 58 | |
| 59 | /** |
| 60 | * Returns the Fabric singleton object. |
| 61 | */ |
| 62 | + (instancetype)sharedSDK; |
| 63 | |
| 64 | /** |
| 65 | * This BOOL enables or disables debug logging, such as kit version information. The default value is NO. |
| 66 | */ |
| 67 | @property (nonatomic, assign) BOOL debug; |
| 68 | |
| 69 | /** |
| 70 | * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. |
| 71 | */ |
| 72 | - (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); |
| 73 | |
| 74 | /** |
| 75 | * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. |
| 76 | */ |
| 77 | + (instancetype)new FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); |
| 78 | |
| 79 | @end |
| 80 | |
| 81 | NS_ASSUME_NONNULL_END |
| 82 |