File tree Expand file tree Collapse file tree 6 files changed +16
-7
lines changed Expand file tree Collapse file tree 6 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,8 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIVi
260
260
{
261
261
[super viewWillTransitionToSize: size withTransitionCoordinator: coordinator];
262
262
263
- // We don't need to do anything special on iPad
264
- if (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad) { return ; }
263
+ // We don't need to do anything special on iPad or if we're using character input
264
+ if (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad || self. passcodeType == TOPasscodeTypeCustomAlphanumeric ) { return ; }
265
265
266
266
// Work out if we need to transition to horizontal
267
267
BOOL horizontalLayout = size.height < size.width ;
@@ -378,7 +378,7 @@ - (void)layoutAccessoryButtonsForSize:(CGSize)size
378
378
// The buttons are always embedded in the keypad view on iPad
379
379
if (UI_USER_INTERFACE_IDIOM () != UIUserInterfaceIdiomPhone) { return ; }
380
380
381
- if (self.passcodeView .horizontalLayout ) {
381
+ if (self.passcodeView .horizontalLayout && self. passcodeType != TOPasscodeTypeCustomAlphanumeric ) {
382
382
[self horizontalLayoutAccessoryButtonsForSize: size];
383
383
}
384
384
else {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
12
12
13
13
@class TOPasscodeCircleButton;
14
14
15
- @interface TOPasscodeKeypadView : UIView
15
+ @interface TOPasscodeKeypadView : UIView <UIInputViewAudioFeedback>
16
16
17
17
/* * The type of layout for the buttons (Default is vertical) */
18
18
@property (nonatomic , assign ) BOOL horizontalLayout;
Original file line number Diff line number Diff line change @@ -226,6 +226,12 @@ - (UIImage *)tappedButtonImage
226
226
return _keypadButtons;
227
227
}
228
228
229
+ #pragma mark - Audio Delegate Protocol -
230
+ - (BOOL )enableInputClicksWhenVisible
231
+ {
232
+ return YES ;
233
+ }
234
+
229
235
#pragma mark - Public Layout Setters -
230
236
231
237
- (void )setHorizontalLayout : (BOOL )horizontalLayout
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ - (void)horizontalSizeToFit
295
295
296
296
- (void )sizeToFit
297
297
{
298
- if (self.horizontalLayout ) {
298
+ if (self.horizontalLayout && self. passcodeType != TOPasscodeTypeCustomAlphanumeric ) {
299
299
[self horizontalSizeToFit ];
300
300
}
301
301
else {
Original file line number Diff line number Diff line change 10
10
#import " TOPasscodeSettingsKeypadButton.h"
11
11
#import " TOPasscodeButtonLabel.h"
12
12
#import " TOSettingsKeypadImage.h"
13
-
14
13
const CGFloat kTOPasscodeSettingsKeypadButtonInnerSpacing = 7 .0f ;
15
14
const CGFloat kTOPasscodeSettingsKeypadButtonOuterSpacing = 7 .0f ;
16
15
const CGFloat kTOPasscodeSettingsKeypadCornderRadius = 10 .0f ;
@@ -237,14 +236,15 @@ - (void)buttonTapped:(id)sender
237
236
if (self.deleteButtonTappedHandler ) {
238
237
self.deleteButtonTappedHandler ();
239
238
}
240
-
241
239
return ;
242
240
}
243
241
244
242
// Handler for the keypad buttons
245
243
UIButton *button = (UIButton *)sender;
246
244
NSInteger number = button.tag ;
247
245
246
+ [[UIDevice currentDevice ] playInputClick ];
247
+
248
248
if (self.numberButtonTappedHandler ) {
249
249
self.numberButtonTappedHandler (number);
250
250
}
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ - (void)layoutSubviews
101
101
if (!self.submitButton ) { return ; }
102
102
103
103
[self .submitButton sizeToFit ];
104
+ [self bringSubviewToFront: self .submitButton];
105
+
104
106
CGRect frame = self.submitButton .frame ;
105
107
if (!self.horizontalLayout ) {
106
108
frame.origin .x = CGRectGetMaxX (self.bounds ) + self.submitButtonSpacing ;
@@ -200,6 +202,7 @@ - (void)setPasscode:(NSString *)passcode animated:(BOOL)animated
200
202
201
203
if (self.submitButton ) {
202
204
self.submitButton .hidden = (_passcode.length == 0 );
205
+ [self bringSubviewToFront: self .submitButton];
203
206
}
204
207
205
208
if (passcodeIsComplete && self.passcodeCompletedHandler ) {
You can’t perform that action at this time.
0 commit comments