Skip to content

Commit 1c358e3

Browse files
author
dzenbot
committed
Renames 'undoShakingEnabled' property to 'shakeToClearEnabled'
1 parent 691992d commit 1c358e3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Examples/Messenger/Messenger-Shared/MessageViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ - (void)viewDidLoad
6464
self.messages = [[NSMutableArray alloc] initWithArray:reversed];
6565

6666
self.bounces = YES;
67-
self.undoShakingEnabled = YES;
67+
self.shakeToClearEnabled = YES;
6868
self.keyboardPanningEnabled = YES;
6969
self.inverted = YES;
7070

Source/Classes/SLKTextViewController.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) {
6060
@property (nonatomic, assign) BOOL bounces;
6161

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

6566
/** YES if keyboard can be dismissed gradually with a vertical panning gesture. Default is YES. */
6667
@property (nonatomic, assign) BOOL keyboardPanningEnabled;

Source/Classes/SLKTextViewController.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ - (void)commonInit
139139

140140
self.bounces = YES;
141141
self.inverted = YES;
142-
self.undoShakingEnabled = NO;
142+
self.shakeToClearEnabled = NO;
143143
self.keyboardPanningEnabled = YES;
144144
self.shouldClearTextAtRightButtonPress = YES;
145145
self.shouldForceTextInputbarAdjustment = NO;
@@ -547,6 +547,11 @@ - (void)setInverted:(BOOL)inverted
547547
}
548548
}
549549

550+
- (void)setUndoShakingEnabled:(BOOL)enabled
551+
{
552+
_shakeToClearEnabled = enabled;
553+
}
554+
550555
- (void)setKeyboardStatus:(SLKKeyboardStatus)status
551556
{
552557
// Skips if trying to update the same status
@@ -1203,7 +1208,7 @@ - (void)didShakeTextView:(NSNotification *)notification
12031208
}
12041209

12051210
// Notifies of the shake gesture if undo mode is on and the text view is not empty
1206-
if (self.undoShakingEnabled && self.textView.text.length > 0) {
1211+
if (self.shakeToClearEnabled && self.textView.text.length > 0) {
12071212
[self willRequestUndo];
12081213
}
12091214
}

0 commit comments

Comments
 (0)