Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
- @IBOutlet var pickerView: UIPickerView!
- var alunos: [String] = ["Alessandro", "Anselmo", "Bruno", "Felipe", "Gabriel", "Luiz", "Manoel", "Luiz"]
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view, typically from a nib.
- pickerView.delegate = self
- pickerView.dataSource = self
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
- print(__FUNCTION__)
- return 1
- }
- func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
- print(__FUNCTION__)
- return alunos.count
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement