Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Renames 'undoShakingEnabled' property to 'shakeToClearEnabled'
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenbot committed Oct 31, 2014
1 parent 691992d commit 1c358e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)viewDidLoad
self.messages = [[NSMutableArray alloc] initWithArray:reversed];

self.bounces = YES;
self.undoShakingEnabled = YES;
self.shakeToClearEnabled = YES;
self.keyboardPanningEnabled = YES;
self.inverted = YES;

Expand Down
3 changes: 2 additions & 1 deletion Source/Classes/SLKTextViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) {
@property (nonatomic, assign) BOOL bounces;

/** YES if text view's content can be cleaned with a shake gesture. Default is NO. */
@property (nonatomic, assign) BOOL undoShakingEnabled;
@property (nonatomic, assign) BOOL shakeToClearEnabled;
@property (nonatomic, assign) BOOL undoShakingEnabled DEPRECATED_MSG_ATTRIBUTE("Use -shakeToClearEnabled instead");

/** YES if keyboard can be dismissed gradually with a vertical panning gesture. Default is YES. */
@property (nonatomic, assign) BOOL keyboardPanningEnabled;
Expand Down
9 changes: 7 additions & 2 deletions Source/Classes/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)commonInit

self.bounces = YES;
self.inverted = YES;
self.undoShakingEnabled = NO;
self.shakeToClearEnabled = NO;
self.keyboardPanningEnabled = YES;
self.shouldClearTextAtRightButtonPress = YES;
self.shouldForceTextInputbarAdjustment = NO;
Expand Down Expand Up @@ -547,6 +547,11 @@ - (void)setInverted:(BOOL)inverted
}
}

- (void)setUndoShakingEnabled:(BOOL)enabled
{
_shakeToClearEnabled = enabled;
}

- (void)setKeyboardStatus:(SLKKeyboardStatus)status
{
// Skips if trying to update the same status
Expand Down Expand Up @@ -1203,7 +1208,7 @@ - (void)didShakeTextView:(NSNotification *)notification
}

// Notifies of the shake gesture if undo mode is on and the text view is not empty
if (self.undoShakingEnabled && self.textView.text.length > 0) {
if (self.shakeToClearEnabled && self.textView.text.length > 0) {
[self willRequestUndo];
}
}
Expand Down

0 comments on commit 1c358e3

Please sign in to comment.