Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
  4.  
  5. @IBOutlet var pickerView: UIPickerView!
  6.  
  7. var alunos: [String] = ["Alessandro", "Anselmo", "Bruno", "Felipe", "Gabriel", "Luiz", "Manoel", "Luiz"]
  8.  
  9.  
  10. override func viewDidLoad() {
  11. super.viewDidLoad()
  12. // Do any additional setup after loading the view, typically from a nib.
  13.  
  14. pickerView.delegate = self
  15. pickerView.dataSource = self
  16.  
  17.  
  18. }
  19.  
  20. override func didReceiveMemoryWarning() {
  21. super.didReceiveMemoryWarning()
  22. // Dispose of any resources that can be recreated.
  23. }
  24.  
  25.  
  26. func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
  27.  
  28. print(__FUNCTION__)
  29. return 1
  30. }
  31.  
  32. func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
  33.  
  34. print(__FUNCTION__)
  35. return alunos.count
  36. }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement