mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-11 08:34:22 +01:00
feat: make the text input hover when keyboard display
This commit is contained in:
parent
6a5b250bab
commit
1c981910c6
@ -11,6 +11,7 @@ import MastodonSDK
|
||||
import os.log
|
||||
import PhotosUI
|
||||
import UIKit
|
||||
import MastodonUI
|
||||
import MastodonAsset
|
||||
import MastodonLocalization
|
||||
|
||||
@ -132,12 +133,12 @@ extension MastodonRegisterViewController {
|
||||
|
||||
viewModel.setupDiffableDataSource(tableView: tableView)
|
||||
|
||||
// KeyboardResponderService
|
||||
// .configure(
|
||||
// scrollView: tableView,
|
||||
// layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher()
|
||||
// )
|
||||
// .store(in: &disposeBag)
|
||||
KeyboardResponderService
|
||||
.configure(
|
||||
scrollView: tableView,
|
||||
layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher()
|
||||
)
|
||||
.store(in: &disposeBag)
|
||||
|
||||
// gesture
|
||||
view.addGestureRecognizer(tapGestureRecognizer)
|
||||
@ -403,65 +404,3 @@ extension MastodonRegisterViewController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension MastodonRegisterViewController: UITextFieldDelegate {
|
||||
// func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||
// let text = textField.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
//
|
||||
// switch textField {
|
||||
// case usernameTextField:
|
||||
// viewModel.username.value = text
|
||||
// case displayNameTextField:
|
||||
// viewModel.displayName.value = text
|
||||
// case emailTextField:
|
||||
// viewModel.email.value = text
|
||||
// case passwordTextField:
|
||||
// viewModel.password.value = text
|
||||
// case reasonTextField:
|
||||
// viewModel.reason.value = text
|
||||
// default:
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func textFieldDidEndEditing(_ textField: UITextField) {
|
||||
// let text = textField.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
//
|
||||
// switch textField {
|
||||
// case usernameTextField:
|
||||
// viewModel.username.value = text
|
||||
// case displayNameTextField:
|
||||
// viewModel.displayName.value = text
|
||||
// case emailTextField:
|
||||
// viewModel.email.value = text
|
||||
// case passwordTextField:
|
||||
// viewModel.password.value = text
|
||||
// case reasonTextField:
|
||||
// viewModel.reason.value = text
|
||||
// default:
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
// switch textField {
|
||||
// case usernameTextField:
|
||||
// displayNameTextField.becomeFirstResponder()
|
||||
// case displayNameTextField:
|
||||
// emailTextField.becomeFirstResponder()
|
||||
// case emailTextField:
|
||||
// passwordTextField.becomeFirstResponder()
|
||||
// case passwordTextField:
|
||||
// if viewModel.approvalRequired {
|
||||
// reasonTextField.becomeFirstResponder()
|
||||
// } else {
|
||||
// passwordTextField.resignFirstResponder()
|
||||
// }
|
||||
// case reasonTextField:
|
||||
// reasonTextField.resignFirstResponder()
|
||||
// default:
|
||||
// break
|
||||
// }
|
||||
// return true
|
||||
// }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user