Move all public enums to a separate header

This commit is contained in:
Lukas Spieß
2015-10-08 18:12:54 +02:00
parent 5f3bdd33bf
commit 47a70d4e77
5 changed files with 174 additions and 155 deletions

View File

@@ -31,7 +31,7 @@
#import <UIKit/UIKit.h>
#import "HockeySDKFeatureConfig.h"
#import "HockeySDKEnums.h"
@protocol BITHockeyManagerDelegate;
@@ -375,23 +375,6 @@
/// @name Environment
///-----------------------------------------------------------------------------
/**
* HockeySDK App environment
*/
typedef NS_ENUM(NSInteger, BITEnvironment) {
/**
* App has been downloaded from the AppStore
*/
BITEnvironmentAppStore = 0,
/**
* App has been downloaded from TestFlight
*/
BITEnvironmentTestFlight = 1,
/**
* App has been installed by some other mechanism
*/
BITEnvironmentOther = 99
};
/**
Enum that determines what kind of environment the application is installed and running in.

View File

@@ -36,6 +36,7 @@
#import "HockeySDKFeatureConfig.h"
#import "HockeySDKEnums.h"
#import "BITHockeyManager.h"
#import "BITHockeyManagerDelegate.h"
@@ -82,137 +83,9 @@
// By default the SDK retries sending pending data only when the app becomes active.
#define BITHockeyNetworkDidBecomeReachableNotification @"BITHockeyNetworkDidBecomeReachable"
/**
* HockeySDK Crash Reporter error domain
*/
typedef NS_ENUM (NSInteger, BITCrashErrorReason) {
/**
* Unknown error
*/
BITCrashErrorUnknown,
/**
* API Server rejected app version
*/
BITCrashAPIAppVersionRejected,
/**
* API Server returned empty response
*/
BITCrashAPIReceivedEmptyResponse,
/**
* Connection error with status code
*/
BITCrashAPIErrorWithStatusCode
};
extern NSString *const __attribute__((unused)) kBITCrashErrorDomain;
/**
* HockeySDK Update error domain
*/
typedef NS_ENUM (NSInteger, BITUpdateErrorReason) {
/**
* Unknown error
*/
BITUpdateErrorUnknown,
/**
* API Server returned invalid status
*/
BITUpdateAPIServerReturnedInvalidStatus,
/**
* API Server returned invalid data
*/
BITUpdateAPIServerReturnedInvalidData,
/**
* API Server returned empty response
*/
BITUpdateAPIServerReturnedEmptyResponse,
/**
* Authorization secret missing
*/
BITUpdateAPIClientAuthorizationMissingSecret,
/**
* No internet connection
*/
BITUpdateAPIClientCannotCreateConnection
};
extern NSString *const __attribute__((unused)) kBITUpdateErrorDomain;
/**
* HockeySDK Feedback error domain
*/
typedef NS_ENUM(NSInteger, BITFeedbackErrorReason) {
/**
* Unknown error
*/
BITFeedbackErrorUnknown,
/**
* API Server returned invalid status
*/
BITFeedbackAPIServerReturnedInvalidStatus,
/**
* API Server returned invalid data
*/
BITFeedbackAPIServerReturnedInvalidData,
/**
* API Server returned empty response
*/
BITFeedbackAPIServerReturnedEmptyResponse,
/**
* Authorization secret missing
*/
BITFeedbackAPIClientAuthorizationMissingSecret,
/**
* No internet connection
*/
BITFeedbackAPIClientCannotCreateConnection
};
extern NSString *const __attribute__((unused)) kBITFeedbackErrorDomain;
/**
* HockeySDK Authenticator error domain
*/
typedef NS_ENUM(NSInteger, BITAuthenticatorReason) {
/**
* Unknown error
*/
BITAuthenticatorErrorUnknown,
/**
* Network error
*/
BITAuthenticatorNetworkError,
/**
* API Server returned invalid response
*/
BITAuthenticatorAPIServerReturnedInvalidResponse,
/**
* Not Authorized
*/
BITAuthenticatorNotAuthorized,
/**
* Unknown Application ID (configuration error)
*/
BITAuthenticatorUnknownApplicationID,
/**
* Authorization secret missing
*/
BITAuthenticatorAuthorizationSecretMissing,
/**
* Not yet identified
*/
BITAuthenticatorNotIdentified,
};
extern NSString *const __attribute__((unused)) kBITAuthenticatorErrorDomain;
/**
* HockeySDK global error domain
*/
typedef NS_ENUM(NSInteger, BITHockeyErrorReason) {
/**
* Unknown error
*/
BITHockeyErrorUnknown
};
extern NSString *const __attribute__((unused)) kBITHockeyErrorDomain;

157
Classes/HockeySDKEnums.h Normal file
View File

@@ -0,0 +1,157 @@
//
// HockeySDKEnums.h
// HockeySDK
//
// Created by Lukas Spieß on 08/10/15.
//
//
#ifndef HockeySDK_HockeyEnums_h
#define HockeySDK_HockeyEnums_h
/**
* HockeySDK App environment
*/
typedef NS_ENUM(NSInteger, BITEnvironment) {
/**
* App has been downloaded from the AppStore
*/
BITEnvironmentAppStore = 0,
/**
* App has been downloaded from TestFlight
*/
BITEnvironmentTestFlight = 1,
/**
* App has been installed by some other mechanism
*/
BITEnvironmentOther = 99
};
/**
* HockeySDK Crash Reporter error domain
*/
typedef NS_ENUM (NSInteger, BITCrashErrorReason) {
/**
* Unknown error
*/
BITCrashErrorUnknown,
/**
* API Server rejected app version
*/
BITCrashAPIAppVersionRejected,
/**
* API Server returned empty response
*/
BITCrashAPIReceivedEmptyResponse,
/**
* Connection error with status code
*/
BITCrashAPIErrorWithStatusCode
};
/**
* HockeySDK Update error domain
*/
typedef NS_ENUM (NSInteger, BITUpdateErrorReason) {
/**
* Unknown error
*/
BITUpdateErrorUnknown,
/**
* API Server returned invalid status
*/
BITUpdateAPIServerReturnedInvalidStatus,
/**
* API Server returned invalid data
*/
BITUpdateAPIServerReturnedInvalidData,
/**
* API Server returned empty response
*/
BITUpdateAPIServerReturnedEmptyResponse,
/**
* Authorization secret missing
*/
BITUpdateAPIClientAuthorizationMissingSecret,
/**
* No internet connection
*/
BITUpdateAPIClientCannotCreateConnection
};
/**
* HockeySDK Feedback error domain
*/
typedef NS_ENUM(NSInteger, BITFeedbackErrorReason) {
/**
* Unknown error
*/
BITFeedbackErrorUnknown,
/**
* API Server returned invalid status
*/
BITFeedbackAPIServerReturnedInvalidStatus,
/**
* API Server returned invalid data
*/
BITFeedbackAPIServerReturnedInvalidData,
/**
* API Server returned empty response
*/
BITFeedbackAPIServerReturnedEmptyResponse,
/**
* Authorization secret missing
*/
BITFeedbackAPIClientAuthorizationMissingSecret,
/**
* No internet connection
*/
BITFeedbackAPIClientCannotCreateConnection
};
/**
* HockeySDK Authenticator error domain
*/
typedef NS_ENUM(NSInteger, BITAuthenticatorReason) {
/**
* Unknown error
*/
BITAuthenticatorErrorUnknown,
/**
* Network error
*/
BITAuthenticatorNetworkError,
/**
* API Server returned invalid response
*/
BITAuthenticatorAPIServerReturnedInvalidResponse,
/**
* Not Authorized
*/
BITAuthenticatorNotAuthorized,
/**
* Unknown Application ID (configuration error)
*/
BITAuthenticatorUnknownApplicationID,
/**
* Authorization secret missing
*/
BITAuthenticatorAuthorizationSecretMissing,
/**
* Not yet identified
*/
BITAuthenticatorNotIdentified,
};
/**
* HockeySDK global error domain
*/
typedef NS_ENUM(NSInteger, BITHockeyErrorReason) {
/**
* Unknown error
*/
BITHockeyErrorUnknown
};
#endif /* HockeySDK_HockeyEnums_h */

View File

@@ -278,6 +278,8 @@
1EF95CA7162CB037000AE3AD /* BITFeedbackActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EF95CA5162CB036000AE3AD /* BITFeedbackActivity.m */; };
1EF95CAA162CB314000AE3AD /* BITFeedbackComposeViewControllerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EF95CA9162CB313000AE3AD /* BITFeedbackComposeViewControllerDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
1EFF03E517F2485500A5F13C /* BITCrashManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EFF03E417F2485500A5F13C /* BITCrashManagerTests.m */; };
807756401BC6A44E0037C3DA /* HockeySDKEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 8077563F1BC6A44D0037C3DA /* HockeySDKEnums.h */; settings = {ATTRIBUTES = (Public, ); }; };
807756411BC6B6050037C3DA /* HockeySDKEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 8077563F1BC6A44D0037C3DA /* HockeySDKEnums.h */; settings = {ATTRIBUTES = (Public, ); }; };
846A901F1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 846A901D1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.h */; };
846A90201B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 846A901D1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.h */; };
846A90211B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 846A901E1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.mm */; };
@@ -526,6 +528,7 @@
1EF95CA9162CB313000AE3AD /* BITFeedbackComposeViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITFeedbackComposeViewControllerDelegate.h; sourceTree = "<group>"; };
1EFF03D717F20F8300A5F13C /* BITCrashManagerPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BITCrashManagerPrivate.h; sourceTree = "<group>"; };
1EFF03E417F2485500A5F13C /* BITCrashManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITCrashManagerTests.m; sourceTree = "<group>"; };
8077563F1BC6A44D0037C3DA /* HockeySDKEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HockeySDKEnums.h; sourceTree = "<group>"; };
846A901D1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITCrashCXXExceptionHandler.h; sourceTree = "<group>"; };
846A901E1B20B0EB0076BB80 /* BITCrashCXXExceptionHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BITCrashCXXExceptionHandler.mm; sourceTree = "<group>"; };
973EC8B518BCA8A200DBFFBB /* BITRectangleImageAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITRectangleImageAnnotation.h; sourceTree = "<group>"; };
@@ -755,8 +758,12 @@
1E754E441621F95E0070AB92 /* Helper */ = {
isa = PBXGroup;
children = (
1E49A4D4161222D400463151 /* HockeySDKPrivate.h */,
1E49A4D5161222D400463151 /* HockeySDKPrivate.m */,
1E49A4A7161222B900463151 /* BITAppStoreHeader.h */,
1E49A4A8161222B900463151 /* BITAppStoreHeader.m */,
1EACC979162F041E007578C5 /* BITAttributedLabel.h */,
1EACC97A162F041E007578C5 /* BITAttributedLabel.m */,
1EB92E711955C38C0093C8B6 /* BITHockeyAttachment.h */,
1EB92E721955C38C0093C8B6 /* BITHockeyAttachment.m */,
1E49A4A0161222B900463151 /* BITHockeyBaseManager.h */,
1E49A4A1161222B900463151 /* BITHockeyBaseManager.m */,
1E49A4A2161222B900463151 /* BITHockeyBaseManagerPrivate.h */,
@@ -766,17 +773,14 @@
1E49A4A6161222B900463151 /* BITHockeyHelper.m */,
1E0FEE26173BDB260061331F /* BITKeychainUtils.h */,
1E0FEE27173BDB260061331F /* BITKeychainUtils.m */,
1EACC979162F041E007578C5 /* BITAttributedLabel.h */,
1EACC97A162F041E007578C5 /* BITAttributedLabel.m */,
1E49A4A7161222B900463151 /* BITAppStoreHeader.h */,
1E49A4A8161222B900463151 /* BITAppStoreHeader.m */,
1E49A4A9161222B900463151 /* BITStoreButton.h */,
1E49A4AA161222B900463151 /* BITStoreButton.m */,
1E49A4AB161222B900463151 /* BITWebTableViewCell.h */,
1E49A4AC161222B900463151 /* BITWebTableViewCell.m */,
1EB92E711955C38C0093C8B6 /* BITHockeyAttachment.h */,
1EB92E721955C38C0093C8B6 /* BITHockeyAttachment.m */,
8077563F1BC6A44D0037C3DA /* HockeySDKEnums.h */,
1E3A260E1B2B207900D59683 /* HockeySDKNullability.h */,
1E49A4D4161222D400463151 /* HockeySDKPrivate.h */,
1E49A4D5161222D400463151 /* HockeySDKPrivate.m */,
);
name = Helper;
sourceTree = "<group>";
@@ -1098,6 +1102,7 @@
973EC8BB18BDE29800DBFFBB /* BITArrowImageAnnotation.h in Headers */,
1E49A4C4161222B900463151 /* BITAppStoreHeader.h in Headers */,
1E49A4CA161222B900463151 /* BITStoreButton.h in Headers */,
807756401BC6A44E0037C3DA /* HockeySDKEnums.h in Headers */,
973EC8B718BCA8A200DBFFBB /* BITRectangleImageAnnotation.h in Headers */,
1E49A4D0161222B900463151 /* BITWebTableViewCell.h in Headers */,
1EB6181F1B0A5FA70035A986 /* BITAuthenticator_Private.h in Headers */,
@@ -1148,6 +1153,7 @@
1EB617A41B0A31940035A986 /* BITUpdateManager.h in Headers */,
1EB617AC1B0A31BA0035A986 /* BITHockeyManager.h in Headers */,
1EB617A71B0A31A30035A986 /* BITUpdateViewController.h in Headers */,
807756411BC6B6050037C3DA /* HockeySDKEnums.h in Headers */,
1EB617631B0A30AE0035A986 /* BITHockeyHelper.h in Headers */,
1EB617A51B0A319A0035A986 /* BITUpdateManagerDelegate.h in Headers */,
1EB617CF1B0A344A0035A986 /* BITHockeyAppClient.h in Headers */,

View File

@@ -16,7 +16,7 @@
#define MOCKITO_SHORTHAND
#import <OCMockitoIOS/OCMockitoIOS.h>
#import "HockeySDKFeatureConfig.h"
#import "HockeySDK.h"
#import "BITStoreUpdateManager.h"
#import "BITStoreUpdateManagerPrivate.h"
#import "BITHockeyBaseManager.h"