File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 */
3131+ (void )toggle ;
3232
33+ /* *
34+ * Disables toggling the shared EYLogTextView instance visibility on device shake.
35+ */
36+ + (void )disableShakeToggle ;
37+
38+ /* *
39+ * Enables toggling the shared EYLogTextView instance visibility on device shake.
40+ */
41+ + (void )enableShakeToggle ;
42+
3343/* *
3444 * Clears the text on the shared EYLogTextView instance.
3545 */
Original file line number Diff line number Diff line change 1111
1212#pragma mark - UIResponder swizzle for detecting device shake
1313
14+ @interface EYLogTextView ()
15+ + (void )toggleIfAllowed ;
16+ @end
17+
1418@implementation UIResponder (EYLogTextView)
1519
1620+ (void )setupShakeMotionDetection
@@ -26,7 +30,7 @@ - (void)EYLogTextView_motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)ev
2630{
2731 [self EYLogTextView_motionEnded: motion withEvent: event];
2832
29- [EYLogTextView toggle ];
33+ [EYLogTextView toggleIfAllowed ];
3034}
3135
3236@end
@@ -134,6 +138,7 @@ - (void)present
134138
135139@interface EYLogTextView ()
136140@property BOOL shouldStayOnTop;
141+ @property BOOL shouldToggleOnShake;
137142@end
138143
139144
@@ -175,6 +180,27 @@ + (void)toggle
175180}
176181
177182
183+ + (void )toggleIfAllowed
184+ {
185+ if (EYLogTextView.sharedInstance .shouldToggleOnShake )
186+ {
187+ [EYLogTextView.sharedInstance toggleWithAnimation ];
188+ }
189+ }
190+
191+
192+ + (void )disableShakeToggle
193+ {
194+ EYLogTextView.sharedInstance .shouldToggleOnShake = NO ;
195+ }
196+
197+
198+ + (void )enableShakeToggle
199+ {
200+ EYLogTextView.sharedInstance .shouldToggleOnShake = YES ;
201+ }
202+
203+
178204+ (void )clear
179205{
180206 EYLogTextView.sharedInstance .text = @" " ;
You can’t perform that action at this time.
0 commit comments