зеркало из https://github.com/nextcloud/talk-ios.git
Declare a static let for TextFieldTableViewCell identifier.
Signed-off-by: Ivan Sein <ivan@nextcloud.com> [skip ci]
This commit is contained in:
Родитель
c1d7c9ea60
Коммит
122306dce5
|
@ -119,7 +119,7 @@ import UIKit
|
|||
self.tableView.dataSource = self
|
||||
self.tableView.delegate = self
|
||||
self.tableView.keyboardDismissMode = UIScrollView.KeyboardDismissMode.onDrag
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: textFieldCellIdentifier)
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: TextFieldTableViewCell.identifier)
|
||||
}
|
||||
|
||||
// MARK: - Table view data source
|
||||
|
@ -193,7 +193,7 @@ import UIKit
|
|||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
if indexPath.section == PollCreationSection.kPollCreationSectionQuestion.rawValue {
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: textFieldCellIdentifier)
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: TextFieldTableViewCell.identifier)
|
||||
textInputCell.textField.delegate = self
|
||||
textInputCell.textField.placeholder = NSLocalizedString("Ask a question", comment: "")
|
||||
textInputCell.textField.tag = kQuestionTextFieldTag
|
||||
|
@ -205,7 +205,7 @@ import UIKit
|
|||
actionCell.textLabel?.text = NSLocalizedString("Add answer", comment: "")
|
||||
return actionCell
|
||||
} else if indexPath.row < options.count {
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: textFieldCellIdentifier)
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: TextFieldTableViewCell.identifier)
|
||||
textInputCell.textField.delegate = self
|
||||
textInputCell.textField.placeholder = NSLocalizedString("Answer", comment: "") + " " + String(indexPath.row + 1)
|
||||
textInputCell.textField.tag = indexPath.row
|
||||
|
|
|
@ -69,7 +69,7 @@ enum RoomAvatarInfoSection: Int {
|
|||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: textFieldCellIdentifier)
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: TextFieldTableViewCell.identifier)
|
||||
self.tableView.register(TextViewTableViewCell.self, forCellReuseIdentifier: TextViewTableViewCell.identifier)
|
||||
self.tableView.tableHeaderView = self.headerView
|
||||
|
||||
|
@ -127,7 +127,7 @@ enum RoomAvatarInfoSection: Int {
|
|||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
if indexPath.section == RoomAvatarInfoSection.kRoomNameSection.rawValue {
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: textFieldCellIdentifier)
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: TextFieldTableViewCell.identifier)
|
||||
textInputCell.textField.delegate = self
|
||||
textInputCell.textField.text = self.room.displayName
|
||||
return textInputCell
|
||||
|
|
|
@ -90,7 +90,7 @@ enum RoomVisibilityOption: Int {
|
|||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(self.cancelButtonPressed))
|
||||
self.navigationItem.leftBarButtonItem?.tintColor = NCAppBranding.themeTextColor()
|
||||
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: textFieldCellIdentifier)
|
||||
self.tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: TextFieldTableViewCell.identifier)
|
||||
self.tableView.register(TextViewTableViewCell.self, forCellReuseIdentifier: TextViewTableViewCell.identifier)
|
||||
self.tableView.register(UINib(nibName: kContactsTableCellNibName, bundle: nil), forCellReuseIdentifier: kContactCellIdentifier)
|
||||
self.tableView.tableHeaderView = self.headerView
|
||||
|
@ -426,7 +426,7 @@ enum RoomVisibilityOption: Int {
|
|||
let roomCreationSection = sections[indexPath.section]
|
||||
|
||||
if roomCreationSection == RoomCreationSection.kRoomNameSection.rawValue {
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: textFieldCellIdentifier)
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: TextFieldTableViewCell.identifier)
|
||||
textInputCell.textField.tag = kRoomNameTextFieldTag
|
||||
textInputCell.textField.delegate = self
|
||||
textInputCell.textField.text = self.roomName
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
let textFieldCellIdentifier = "textFieldCellIdentifier"
|
||||
|
||||
class TextFieldTableViewCell: UITableViewCell {
|
||||
|
||||
static let identifier = "textFieldCellIdentifier"
|
||||
|
||||
let textField: UITextField = {
|
||||
let textField = UITextField()
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class UserProfileTableViewController: UITableViewController, DetailedOptionsSele
|
|||
modifyingProfileView = UIActivityIndicatorView()
|
||||
modifyingProfileView.color = NCAppBranding.themeTextColor()
|
||||
tableView.keyboardDismissMode = UIScrollView.KeyboardDismissMode.onDrag
|
||||
tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: textFieldCellIdentifier)
|
||||
tableView.register(TextFieldTableViewCell.self, forCellReuseIdentifier: TextFieldTableViewCell.identifier)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(userProfileImageUpdated), name: NSNotification.Name.NCUserProfileImageUpdated, object: nil)
|
||||
|
||||
if navigationController?.viewControllers.first == self {
|
||||
|
@ -277,7 +277,7 @@ extension UserProfileTableViewController {
|
|||
// MARK: Setup cells
|
||||
|
||||
func textInputCellWith(text: String?, tag: Int, interactionEnabled: Bool, keyBoardType: UIKeyboardType = .default, autocapitalizationType: UITextAutocapitalizationType = .sentences, placeHolder: String = "") -> TextFieldTableViewCell {
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: textFieldCellIdentifier)
|
||||
let textInputCell: TextFieldTableViewCell = tableView.dequeueOrCreateCell(withIdentifier: TextFieldTableViewCell.identifier)
|
||||
|
||||
textInputCell.textField.delegate = self
|
||||
textInputCell.textField.text = text
|
||||
|
|
Загрузка…
Ссылка в новой задаче