Browse Source

textfield shown when keyboard shown

pull/1/head
gme_2 6 years ago
parent
commit
27e274886d
  1. 25
      GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift

25
GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift

@ -454,12 +454,29 @@ extension ExchangeRatesViewController: FetchCountryCurrencyInformation, getExcha
extension ExchangeRatesViewController: UITextFieldDelegate {
func textFieldDidBeginEditing(_ textField: UITextField) {
if textField == senderTextField {
if Utility.getDeviceModel() == .iphone678 || Utility.getDeviceModel() == .iphone5 {
let transformDistance: CGFloat = -75
UIView.animate(withDuration: 0.33) {
self.view.transform = CGAffineTransform.init(translationX: 0, y: transformDistance)
}
}
}
}
func textFieldDidEndEditing(_ textField: UITextField) {
// self.view.endEditing(true)
DispatchQueue.main.async {
textField.resignFirstResponder()
if textField == senderTextField {
UIView.animate(withDuration: 0.22, animations: {
self.view.transform = CGAffineTransform.identity
}) { (_) in
self.calculateExchangeRate(nil)
}
}
self.calculateExchangeRate(nil)
}
}

Loading…
Cancel
Save