forked from zelo72/mastodon-ios
commit
909acdcfa3
|
@ -115,6 +115,7 @@ extension MastodonRegisterTextFieldTableViewCell {
|
|||
label.font = MastodonRegisterTextFieldTableViewCell.textFieldLabelFont
|
||||
label.textColor = Asset.Colors.Label.primary.color
|
||||
label.text = text
|
||||
label.lineBreakMode = .byTruncatingMiddle
|
||||
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
containerView.addSubview(label)
|
||||
|
@ -123,6 +124,7 @@ extension MastodonRegisterTextFieldTableViewCell {
|
|||
label.leadingAnchor.constraint(equalTo: paddingView.trailingAnchor),
|
||||
containerView.trailingAnchor.constraint(equalTo: label.trailingAnchor, constant: 16),
|
||||
label.bottomAnchor.constraint(equalTo: containerView.bottomAnchor),
|
||||
label.widthAnchor.constraint(lessThanOrEqualToConstant: 180).priority(.required - 1),
|
||||
])
|
||||
return containerView
|
||||
}()
|
||||
|
|
|
@ -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