Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. class UserProfileTableViewController: UITableViewController {
  2.  
  3. private var userInfoCell: UserInfoTableViewCell?
  4. ...
  5.  
  6. override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
  7.  
  8. if indexPath.section == 0 {
  9. userInfoCell = tableView.dequeueReusableCellWithIdentifier("userInfoCell", forIndexPath: indexPath) as? UserInfoTableViewCell
  10.  
  11. if !editMode {
  12. userInfoCell?.nameField.becomeFirstResponder()
  13. }
  14.  
  15. return userInfoCell!
  16. }
  17. else if indexPath.section == 1 {
  18. ....
  19.  
  20. class UserInfoTableViewCell: UITableViewCell, UITextFieldDelegate,, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
  21.  
  22. @IBOutlet weak var nameField: UITextField!
  23. @IBOutlet weak var photoImageView: UIImageView!
  24. ...
  25.  
  26. override func awakeFromNib() {
  27. super.awakeFromNib()
  28. // listen for when user touches a textfield
  29. nameField.delegate = self
  30. ...
  31. }
  32.  
  33. override func setSelected(selected: Bool, animated: Bool) {
  34. super.setSelected(selected, animated: animated)
  35. }
  36.  
  37. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement