Accessing cell attributes outside of cellForRowAtIndexPath

后端 未结 5 1271
既然无缘
既然无缘 2021-01-18 09:56

I have five fields setup on a Signup controller. Username, displayname, password, confirm password and email address.

They are setup with the following:



        
5条回答
  •  情话喂你
    2021-01-18 10:13

    Updated Swift,

    let cell = tableView.cellForRow(at: indexPath) as! 
    

    Then you can access all the objects inside your cell the same way as when you are in cellforrowat

    let displayname = cell.labelfordisplayname.text!
    print("This is the displayname -> \(displayname)")
    

提交回复
热议问题