diff --git a/ios/TPSStripe/TPSCardField.m b/ios/TPSStripe/TPSCardField.m index a1b3a2c96..7af2eb506 100644 --- a/ios/TPSStripe/TPSCardField.m +++ b/ios/TPSStripe/TPSCardField.m @@ -19,10 +19,6 @@ @implementation TPSCardField { STPPaymentCardTextField *_paymentCardTextField; } -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:self.window]; -} - - (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { _isFirstResponder = NO; @@ -30,11 +26,6 @@ - (instancetype)initWithFrame:(CGRect)frame { _paymentCardTextField.delegate = self; [self addSubview:_paymentCardTextField]; self.backgroundColor = [UIColor clearColor]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:self.window]; } return self; } @@ -60,24 +51,14 @@ - (void)reactBlur { [self resignFirstResponder]; } -// Deprecated API -- removed in 2017, clean this up after RN 0.45 or lower support is dropped -- (void)reactWillMakeFirstResponder { - _jsRequestingFirstResponder = YES; -} - - (BOOL)canBecomeFirstResponder { return _jsRequestingFirstResponder; } -// Deprecated API -- removed in 2017, clean this up after RN 0.45 or lower support is dropped -- (void)reactDidMakeFirstResponder { - _jsRequestingFirstResponder = NO; -} - - (void)didMoveToWindow { if (_jsRequestingFirstResponder) { [_paymentCardTextField becomeFirstResponder]; - [self reactDidMakeFirstResponder]; + _jsRequestingFirstResponder = NO; } }