-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourses.swift
34 lines (29 loc) · 869 Bytes
/
Courses.swift
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
//
// Courses.swift
// Roll_Call
//
// Created by Anthony Powell on 8/9/16.
// Copyright © 2016 Anthony Powell. All rights reserved.
//
import UIKit
import Firebase
class Courses: NSObject {
var couresDiction: NSArray?
var foundCourses: Bool = false
var courseNumber: String?
var courseInstructor: String?
var courseTime: String?
var courseLocation: String?
func getCourseFromDB(){
let courseRef = FIRDatabase.database().reference().child("Courses").child("Codes")
courseRef.observe(.value, with: { (s) in
if ((s.value as? [NSArray]) != nil){
self.foundCourses = true
self.couresDiction = s.value as? [NSArray] as NSArray?
print(self.couresDiction)
}else{
self.foundCourses = false
}
})
}
}