KiranSarvaiya KiranSarvaiya - 1 month ago 16
iOS Question

Get Value more then one TextField From Tableview cell?

I have Table and First 2 Row in Textfield. I Want to get Value from Both But i how Can I get that

Image Representation

Code :-

let cell = tableView.dequeueReusableCellWithIdentifier("csttblcell", forIndexPath: indexPath)
cell.textLabel?.text = cellTitle[indexPath.row]
txtcontent = cell.contentView.viewWithTag(101) as! UITextField

Answer
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
cell = tableView.dequeueReusableCellWithIdentifier("csttblcell", forIndexPath: indexPath) as! AddSubTableViewCell
cell.textLabel?.text = cellTitle[indexPath.row]
cell.Textfieldcell.tag = 10 + indexPath.row
cell.lbladd.tag = 20 + indexPath.row
}
@IBAction func btnAddData(sender: UIButton)
{
txtFname = tble_subsc.viewWithTag(10) as! UITextField
txtfdis = tble_subsc.viewWithTag(11)  as! UITextField
let fname = txtFname.text
let dis = txtfdis.text
}