-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPINVC.swift
More file actions
69 lines (45 loc) · 1.81 KB
/
PINVC.swift
File metadata and controls
69 lines (45 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// PINVC.swift
// MobileGrowthMonitor
//
// Created by Jacqueline on 15.03.17.
// Copyright © 2017 Jacqueline Franßen. All rights reserved.
//
import UIKit
class PINVC: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate {
@IBOutlet weak var textField: UITextField!
@IBOutlet weak var label: UILabel!
@IBOutlet weak var pickerView: UIPickerView!
@IBOutlet weak var enterButton: UIButton!
@IBOutlet weak var pinChangeButton: UIButton!
@IBOutlet weak var pinDeactiveButton: UIButton!
var firstNums = ["0","1","2","3" ,"4","5","6","7","8","9"]
var picker = UIPickerView()
// let doneButton = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.plain, target: self, action: "donePicker")
//MARK: Properties
override func viewDidLoad() {
super.viewDidLoad()
picker.delegate = self
picker.dataSource = self
textField.inputView = picker
picker.accessibilityActivate()
//picker.accessibilityDecrement()
}
//MARK: -IBActions
@IBAction func nextViewButtonPressed(_ sender: Any) {
print("Button pressed")
self.performSegue(withIdentifier: "SecondViewSegue", sender: self)
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 4
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component:Int)->Int{
return firstNums.count
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
textField.text = firstNums[row] + " ";
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return firstNums[row]
}
}