Skip to content

Commit

Permalink
Adds functionality to remove custom actions from the menu, when required
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Silk committed May 22, 2018
1 parent c75e2dc commit d5ec44f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DBDebugToolkit/Classes/DBDebugToolkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@
*/
+ (void)addCustomActions:(NSArray <DBCustomAction *> *)customActions;

/**
Removes a single `DBCustomAction` instance from the array accessible in the menu.
@param customAction The `DBCustomAction` instance that should be removed.
*/
+ (void)removeCustomAction:(DBCustomAction *)customAction;

/**
Removes multiple `DBCustomAction` instances from the array accessible in the menu.
@param customActions An array of `DBCustomAction` instances that should be accessible in the menu.
*/
+ (void)removeCustomActions:(NSArray <DBCustomAction *> *)customActions;

///-----------------------
/// @name Custom variables
///-----------------------
Expand Down
10 changes: 10 additions & 0 deletions DBDebugToolkit/Classes/DBDebugToolkit.m
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ + (void)addCustomActions:(NSArray <DBCustomAction *> *)customActions {
[toolkit.customActions addObjectsFromArray:customActions];
}

+ (void)removeCustomAction:(DBCustomAction *)customAction {
DBDebugToolkit *toolkit = [DBDebugToolkit sharedInstance];
[toolkit.customActions removeObject:customAction];
}

+ (void)removeCustomActions:(NSArray <DBCustomAction *> *)customActions {
DBDebugToolkit *toolkit = [DBDebugToolkit sharedInstance];
[toolkit.customActions removeObjectsInArray:customActions];
}

#pragma mark - Custom variables

- (void)setupCustomVariables {
Expand Down

0 comments on commit d5ec44f

Please sign in to comment.