Guest User

Untitled

a guest
Feb 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class SemanaViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UIPickerViewDataSource, UIPickerViewDelegate {
  2.  
  3. let letters = ["A","B","C","D","F","G","H"]
  4.  
  5. @IBOutlet weak var pickerView: UIPickerView!
  6.  
  7. override func viewDidLoad() {
  8. super.viewDidLoad()
  9. self.tableView.delegate = self
  10. self.tableView.dataSource = self
  11. self.pickerView.dataSource = self
  12. self.pickerView.delegate = self
  13. ....
  14. }
  15. ....
  16. func numberOfComponents(in pickerView: UIPickerView) -> Int {
  17. return 1
  18. }
  19.  
  20. func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
  21. return letters.count
  22. }
  23.  
  24.  
  25. func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
  26. return letters[row]
  27. }
Add Comment
Please, Sign In to add comment