Make individual components delegate private

The `delegate` property should only be set on `[BITHockeyManager sharedHockeyManager]` which will then propagade it to all components. Setting the delegate individually per component could cause undefined behaviour.
This commit is contained in:
Andreas Linde
2014-06-18 15:52:56 +02:00
parent fbfd4ae0fb
commit 83b32ffe37
10 changed files with 69 additions and 70 deletions

View File

@@ -198,18 +198,6 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
*/
@property (nonatomic, copy) NSString *authenticationSecret;
/**
Delegate that can be used to do any last minute configurations on the
presented viewController.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
@see BITAuthenticatorDelegate
*/
@property (nonatomic, weak) id<BITAuthenticatorDelegate> delegate;
#pragma mark - Device based identification

View File

@@ -34,6 +34,18 @@
@interface BITAuthenticator ()<BITAuthenticationViewControllerDelegate, UIAlertViewDelegate>
/**
Delegate that can be used to do any last minute configurations on the
presented viewController.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
@see BITAuthenticatorDelegate
*/
@property (nonatomic, weak) id<BITAuthenticatorDelegate> delegate;
/**
* must be set
*/

View File

@@ -157,21 +157,6 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) {
@interface BITCrashManager : BITHockeyBaseManager
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the optional `BITCrashManagerDelegate` delegate.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id delegate;
///-----------------------------------------------------------------------------
/// @name Configuration
///-----------------------------------------------------------------------------

View File

@@ -38,6 +38,21 @@
@interface BITCrashManager () {
}
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the optional `BITCrashManagerDelegate` delegate.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id delegate;
/**
* must be set
*/

View File

@@ -136,23 +136,6 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) {
@interface BITFeedbackManager : BITHockeyBaseManager
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the `BITFeedbackManagerDelegate` delegate.
Can be set to be notified when new feedback is received from the server.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id<BITFeedbackManagerDelegate> delegate;
///-----------------------------------------------------------------------------
/// @name General settings
///-----------------------------------------------------------------------------

View File

@@ -36,6 +36,23 @@
}
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the `BITFeedbackManagerDelegate` delegate.
Can be set to be notified when new feedback is received from the server.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id<BITFeedbackManagerDelegate> delegate;
@property (nonatomic, strong) NSMutableArray *feedbackList;
@property (nonatomic, strong) NSString *token;

View File

@@ -75,16 +75,6 @@ typedef NS_ENUM(NSInteger, BITStoreUpdateSetting) {
@interface BITStoreUpdateManager : BITHockeyBaseManager
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the optional `BITStoreUpdateManagerDelegate` delegate.
*/
@property (nonatomic, weak) id delegate;
///-----------------------------------------------------------------------------
/// @name Update Checking
///-----------------------------------------------------------------------------

View File

@@ -34,6 +34,16 @@
@interface BITStoreUpdateManager () <UIAlertViewDelegate> {
}
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the optional `BITStoreUpdateManagerDelegate` delegate.
*/
@property (nonatomic, weak) id delegate;
// is an update available?
@property (nonatomic, assign, getter=isUpdateAvailable) BOOL updateAvailable;

View File

@@ -75,22 +75,6 @@ typedef NS_ENUM (NSUInteger, BITUpdateSetting) {
@interface BITUpdateManager : BITHockeyBaseManager <UIAlertViewDelegate>
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the `BITUpdateManagerDelegate` delegate.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id delegate;
///-----------------------------------------------------------------------------
/// @name Update Checking
///-----------------------------------------------------------------------------

View File

@@ -39,6 +39,21 @@
@interface BITUpdateManager () {
}
///-----------------------------------------------------------------------------
/// @name Delegate
///-----------------------------------------------------------------------------
/**
Sets the `BITUpdateManagerDelegate` delegate.
The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You
should not need to set this delegate individually.
@see `[BITHockeyManager setDelegate:]`
*/
@property (nonatomic, weak) id delegate;
// is an update available?
@property (nonatomic, assign, getter=isUpdateAvailable) BOOL updateAvailable;