2
2
// Wilcox Bells
3
3
//
4
4
// Created by Claire Dong on 7/17/18.
5
- // Copyright © 2018 Wilcox High School. All rights reserved.
5
+ // Copyright ©o 2018 Wilcox High School. All rights reserved.
6
6
7
7
import UIKit
8
8
import UserNotifications
9
9
10
10
class ViewController : UIViewController , UITableViewDelegate , UITableViewDataSource {
11
11
12
+ @IBOutlet weak var tableview : UITableView !
12
13
//@IBOutlet weak var tableView: UITableView!
13
- @IBOutlet weak var viewForTable : UIView !
14
- var tableview : UITableView !
14
+ // @IBOutlet weak var viewForTable: UIView!
15
+ // var tableview: UITableView!
15
16
16
17
@IBAction func switchDay( _ sender: UISegmentedControl ) {
17
18
p = sender. selectedSegmentIndex
@@ -33,33 +34,35 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
33
34
@IBOutlet weak var morning : UILabel !
34
35
@IBOutlet weak var weekend : UILabel !
35
36
36
- func tableView( _ tableView: UITableView , numberOfRowsInSection section: Int ) -> Int {
37
+
38
+ func tableView( _ tV: UITableView , numberOfRowsInSection section: Int ) -> Int {
37
39
return sched [ p] . count
38
40
}
39
- func tableView( _ tableView : UITableView , cellForRowAt indexPath: IndexPath ) -> UITableViewCell {
40
- let cell = tableView . dequeueReusableCell ( withIdentifier: " CustomCell " ) as! CustomCell
41
+ func tableView( _ tV : UITableView , cellForRowAt indexPath: IndexPath ) -> UITableViewCell {
42
+ let cell = tV . dequeueReusableCell ( withIdentifier: " customCell " ) as! CustomCell
41
43
let str = sched [ p] [ indexPath. row] . components ( separatedBy: " " )
42
44
cell. customInit ( period: str [ 0 ] , time: str [ 1 ] )
43
45
return cell
44
46
}
45
47
46
48
override func viewDidLoad( ) {
47
- print ( viewForTable)
48
- tableview = UITableView ( frame: viewForTable. frame)
49
- viewForTable. addSubview ( tableview)
49
+ // print(viewForTable)
50
+ // tableview = UITableView(frame: viewForTable.frame)
51
+ // viewForTable.addSubview(tableview)
50
52
51
53
//print(tableView)
52
- //tableView = UITableView()
53
- tableview. dataSource = self
54
- tableview. delegate = self
54
+ //tableview = UITableView()
55
+ p = 0
56
+
57
+ //tableview.dataSource = self
58
+ //tableview.delegate = self
55
59
56
60
UNUserNotificationCenter . current ( ) . requestAuthorization ( options: [ . alert, . sound] , completionHandler: { didAllow, error in } )
57
61
super. viewDidLoad ( )
58
62
59
63
let nib = UINib ( nibName: " CustomCell " , bundle: nil )
60
- tableview. register ( nib, forCellReuseIdentifier: " CustomCell " )
64
+ tableview. register ( nib, forCellReuseIdentifier: " customCell " )
61
65
62
- p = 0
63
66
64
67
message. isHidden = true ;
65
68
minLeft. isHidden = true ;
0 commit comments