¿Cómo encontrar qué vista de tabla se está editando en textFieldDidEndEditing?
Estoy usando 2tableviews
Ambos tienentextfiled
entableviewcell
,
Estoy recibiendo texto del campo de texto entextFieldDidEndEditing
pero cómo sabría si el texto se está editando pertenece a qué vista de tabla, solo quiero saber la condición en la que puedo diferenciar el texto que proviene del campo de texto para almacenarlo en dos conjuntos diferentes.
func textFieldDidEndEditing(_ textField: UITextField)
{
// let indexOf = txtArray.index(of:textField.tag)
if self.tblAnswer.isEditing
{
let indexOf = textField.tag
if let text = textField.text
{
if allAnsText.indices.contains(indexOf)
{
allAnsText.remove(at: indexOf)
}
if text.isEmpty
{
print("Write some text there")
}
else
{
allAnsText.insert(text, at: indexOf)
print(allAnsText)
}
}
}
else if self.tblVideo.isEditing
{
let indexOf = textField.tag
if let text = textField.text
{
if allMediaText.indices.contains(indexOf)
{
allMediaText.remove(at: indexOf)
}
if text.isEmpty
{
print("Write some text there")
}
else
{
allMediaText.insert(text, at: indexOf)
print(allMediaText)
}
}
}
}