Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
  2. {
  3. var cell: UITableViewCell = UITableViewCell()
  4.  
  5. if indexPath.section == 0
  6. {
  7. cell = tableView.dequeueReusableCell(withIdentifier: "Cell1", for: indexPath)
  8.  
  9. // Do stuff
  10.  
  11. }
  12. else if indexPath.section == 1
  13. {
  14. cell = tableView.dequeueReusableCell(withIdentifier: "Cell1", for: indexPath)
  15.  
  16. // Do stuff
  17.  
  18. }
  19. else if indexPath.section == 2
  20. {
  21. cell = tableView.dequeueReusableCell(withIdentifier: "Cell2", for: indexPath)
  22.  
  23. let wornTextField = cell.viewWithTag(3) as! UITextField
  24. let pickerView: UIPickerView = UIPickerView()
  25.  
  26. pickerView.frame.size.height = (view.frame.size.height / 2)
  27. pickerView.delegate = self
  28. pickerView.dataSource = self
  29.  
  30. wornLabel.text = "Test"
  31.  
  32. wornTextField.tintColor = UIColor.clear
  33. wornTextField.inputView = wearsPickerView
  34. wornTextField.delegate = self
  35. }
  36. else if indexPath.section == 3
  37. {
  38. // Dequeue cell
  39. }
  40.  
  41. return cell
  42. }
  43.  
  44. func numberOfComponents(in pickerView: UIPickerView) -> Int
  45. {
  46. print("This is called 0")
  47. return 1
  48. }
  49.  
  50. func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String?
  51. {
  52. // This is not called, WHY???
  53. return someArray_ARRAY[row]
  54. }
  55.  
  56. func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)
  57. {
  58. print("This is called 2")
  59. }
  60.  
  61. func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int
  62. {
  63. print("This is called 1")
  64. return numOfWears_ARRAY.count
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement