This is a basic app that let’s patients respond to the alarms set by the caretake in Caretaker app.
To read the complete app documentation, go to this link: https://likhongomes.github.io/Smart-Prompter-iOS/
Clone the repository and open it using xcode. click the run button or press cmd+R on keyboard to run the app, on a simulator or your iPhone.
Requirement: iOS 10 or above and xcode version 10 and above.
class Alarm: PersistableRecord, Codable, FetchableRecord
Codable
, FetchableRecord
, PersistableRecord
init()
init(label: String, hour: Int, minute: Int, year: Int, month: Int, day: Int, active: Bool)
var id: Int?
var firebaseID: String?
var label: String?
var year: Int?
var month: Int?
var day: Int?
var hour: Int?
var minute: Int?
var active: Bool?
var status: String?
var deleteRequest: String?
func encode(to container: inout PersistenceContainer)
let alarmDB
Alarm scheduling class to schedule alarm
class AlarmScheduler
Function to schedule alarm for the first time after doanloaded from Firebase. Simply call this function and it will push the alarm to the OS notification center
func scheduleNotification(title: String, dateComponents: DateComponents, id: String?)
- title: alarm identifier string
- dateComponents: The date of the alarm when it should be triggered
- id: Firebase ID fetched from firebase just tracking the alarm data
Reschedule alam once the the alarm is delayed
public func rescheduleNotification(title: String, id: String?)
- title: alarm identifier string
- id: Firebase ID fetched from firebase just tracking the alarm data
Request OS to remove notification from pending list and clear the notification list already delivered
func clearNotifications(title: String)
- title: Alarm identifier string
The alarm view controller that is show after a row on the table is tapped
class AlarmVC: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate
UIImagePickerControllerDelegate
, UINavigationControllerDelegate
, UIViewController
let backButton
let saveButton
let cancelButton
let deleteButton
let buttonStack
let alarmDetailsLabel
let instructionLabel
let dateLabel
let timeLabel
var alarmDelegate: AlarmVCDelegate?
var alarm
let alarmNameTextField
let alarmDateTextField
let alarmTimeTextField
let statusLabel
let statusStatusLabel
let datePicker
let timePicker
let slider
let pictureSlider
let imageView
var notificationTitle: Any?
let takenImageViewer
var alarmIndex
Main function of the view controller, all the important UI and rest of the alarm meta data are downloaded here.
override func viewDidLoad()
Sets up the size/location/shape and style of the imageview
func imageViewSetup()
Sets up the size/location/shape and style of the date picker
func showDatePicker()
Sets up the size/location/shape and style of the imageview for take image
func takenImageViewSetup()
Sets up the size/location/shape and style of the time picker
func showTimePicker()
action when done button is tapped on date picker
@objc func donedatePicker()
action when done button is tapped on time picker
@objc func donetimePicker()
Action to cancel date picker and make it disappear
@objc func cancelDatePicker()
Action when slider value is changed. Updates the current status of the alarm based on the direction of slide. If left, then add delay to the alarm. If right, update the data on firebase and prompt the user to the next step
@objc func changeValue(_ sender: UISlider)
- sender: The slider object itself
Action when slider value is changed. Updates the current status of the alarm based on the direction of slide. If left, then add delay to the alarm. If right, update the data on firebase and prompt the user to the next step
@objc func changeValuePictureSlider(_ sender: UISlider)
- sender: The slider object itself
Action when image picker is done picking image and returns it. It also uploads the image to firebase and updates the status of the alarm
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
Sets up the size/location/shape and style of the alarm date text field
func alarmDateTextFieldSetup()
Sets up the size/location/shape and style of the instruction label
func instructionLabelSetup()
Sets up the size/location/shape and style of the alarm details label
func alarmDetailsLabelSetup()
Sets up the size/location/shape and style of the alarm name text field
func alarmNameTextFieldSetup()
Sets up the size/location/shape and style of the back button
func backButtonSetup()
Action for back button when clicked, takes the user back to the previous screen
@objc func backButtonClicked()
Sets up the size/location/shape and style of the label for the status label
func statusStatusLabelSetup()
Sets up the size/location/shape and style of the slider
func sliderSetup()
Sets up the size/location/shape and style of the slider
func pictureSliderSetup()
protocol AlarmVCDelegate
func reloadTableDelegate()
A type responsible for initializing the application database.
struct AppDatabase
See AppDelegate.setupDatabase()
Creates a fully initialized database at path
static func openDatabase(atPath path: String) throws -> DatabaseQueue
@available(iOS 10.0, *) @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate
UIApplicationDelegate
, UIResponder
, UNUserNotificationCenterDelegate
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
Background fetch function. Tries the fetch data when the app is in background
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
- application: The current application
- completionHandler: checks whether new data has been fetched
func applicationWillResignActive(_ application: UIApplication)
func applicationDidEnterBackground(_ application: UIApplication)
func applicationWillEnterForeground(_ application: UIApplication)
func applicationDidBecomeActive(_ application: UIApplication)
func applicationWillTerminate(_ application: UIApplication)
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)
Sets up the internal swl database which is currently not in use
private func setupDatabase(_ application: UIApplication) throws
Registers the app for push notification
func registerForPushNotifications()
Gets the notification settings for local notification
func getNotificationSettings()
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)
Download the custom notifcation sound that's to be used
func downloadNotificationSound()
class FirebaseUtil
Fetch one particular firebase object using the given firebase ID. Returns a single alarm
func fetchOneObject(firebaseID: String) -> Alarm
- firebaseID: The id of the element trying to fetch from firebase
- Alarm
- AlarmDB
- AlarmScheduler
- AlarmVC
- AppDatabase
- AppDelegate
- FirebaseUtil
- MainVC
- RewardVC
- RootViewController
- SignInVC
- active​Alarm
- alarm​DB
- completed​Task
- db​Queue
- fUtil
- inactive​Alarm
- ref
- scheduler
- total​Task
- user​ID
The main view controlller of the app. Users often see this view controller as a default. This is where all the alarms are fetched from firebase and alarm requests are made to the OS.
class MainVC: UIViewController
AlarmVCDelegate
, UITableViewDataSource
, UITableViewDelegate
, UIViewController
, UNUserNotificationCenterDelegate
let welcomeTextView
let clockLabel
let topBar
let timeLabel
var timer
var date
let calendar
let dateFormatter
let logoutButton
var refreshControl
let summaryLabel
var ref: DatabaseReference!
let alarmTable
func reloadTableDelegate()
This is tha main function where all the important tasks are called, such as loading the UI, Fetching from firebase and loading data into array
override func viewDidLoad()
Updates the time label for the clock shown on screen. Also refreshes the table view after certain time period
@objc func updateTimeLabel()
Reloads data in the table view
@objc func reloadTable()
Sets up the summary label. This label shows how many alarms are remaining to be completed for the day.
func summaryLabelSetup()
Logout button action. Logout the user from the app
@objc func logoutButtonClicked()
Fetches data from firebase and loads them in an array to be supplied to table view
func fetchFromFirebase()
Built in tablie view function. Determines how many rows to be shown in the table
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
- tableView: table view class
- section: number of rows
Sorts out the data to be shown in each row of the table
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
Action to be done when a row is tapped
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)
Sets up the size/location/shape and style of the logout button
func logoutButtonSetup()
Sets up the size/location/shape and style of the alarm table
func alarmTableSetup()
Sets up the size/location/shape and style of the top view
func topViewSetup()
Sets up the size/location/shape and style of the time label
func timeLabelSetup()
Sets up the size/location/shape and style of the welcome text
func welcomeTextViewSetup()
Sets up the size/location/shape and style of the clock label
func clockLabelSetup()
Refreshes the data in the alarm table when the view is loaded
override func viewWillAppear(_ animated: Bool)
class RewardVC: UIViewController
UIViewController
let circleHolder
let percentageLabel
let button
let textView
var fraction
let imageView
let imageArray
override func viewDidLoad()
Sets up the size/location/shape and style of the imageview
func imageViewSetup()
Sets up the size/location/shape and style of the progress circle
func progressCircleSetup()
Sets up the size/location/shape and style of the button
func buttonSetup()
Action when the button is tapped. Takes user back
@objc func buttonClicked()
Sets up the size/location/shape and style of the textview
func textViewSetup()
class RootViewController: UIViewController
UIViewController
override func viewDidLoad()
class SignInVC: UIViewController
UIViewController
let loginButton
let signUpButton
let guestButton
let emailTF
let passwordTF
let backButton
let logoImage
let errorMessageView
Adds a authentication listener to see if the user is signed in
override func viewWillAppear(_ animated: Bool)
Raises the view when the keybaord appears
@objc func keyboardWillShow(notification: NSNotification)
- notification: The notification observer that the keyboard has appeared
Lowers the view when the keyboard disappears
@objc func keyboardWillHide(notification: NSNotification)
- notification: The notification observer that the keybaord has disappeard
Main function of this view controller. All the important tasks are done here such as loading the UI, adding listener for the keyboard etc.
override func viewDidLoad()
Sets up the size/location/shape and style of the error message textview
func errorMessageViewSetup()
Sets up the size/location/shape and style of the logo image
func logoImageSetup()
Sets up the size/location/shape and style of the login button
func loginButtonSetup()
Action when the login button is tapped. Checks if all of the required fields are full and checks with firebase to authenticate
@objc func loginButtonTapped()
Sets up the size/location/shape and style of the signup button
func signUpButtonSetup()
Action when the signup button is tapped. Registers the user in firebase
@objc func signUpButtonTapped()
Sets up the size/location/shape and style of the email textfield
func emailTFSetup()
Sets up the size/location/shape and style of the password textfield
func passwordTFSetup()
Sets up the size/location/shape and style of the back button
func backButtonSetup()
Generated at 2020-05-02T13:21:48-0400 using swift-doc 1.0.0-beta.2.
Types
Protocols
Global Variables
Global Functions
var activeAlarm
var completedTask
var dbQueue: DatabaseQueue!
let fUtil
Get the document directory
func getDocumentsDirectory() -> URL
var inactiveAlarm
var ref: DatabaseReference!
let scheduler
var totalTask
let userID
data structure the alarm
class Alarm: PersistableRecord, Codable, FetchableRecord
Codable
, FetchableRecord
, PersistableRecord
empty initializer
init()
initializer
init(label: String, hour: Int, minute: Int, year: Int, month: Int, day: Int, active: Bool, status: String)
var id: Int?
var firebaseID: String?
var label: String?
var scheduledHour: Int?
var scheduledMinute: Int?
var active: Bool?
var scheduledYear: Int?
var scheduledMonth: Int?
var scheduledDay: Int?
var acknowledgedDay: Int?
var acknowledgedMonth: Int?
var acknowledgedYear: Int?
var acknowledgedHour: Int?
var acknowledgedMinute: Int?
var completedDay: Int?
var completedMonth: Int?
var completedYear: Int?
var completedHour: Int?
var completedMinute: Int?
var status: String?
var deleteRequest: String?
let alarmDB
A type responsible for initializing the application database.
struct AppDatabase
See AppDelegate.setupDatabase()
Creates a fully initialized database at path
static func openDatabase(atPath path: String) throws -> DatabaseQueue
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate
UIApplicationDelegate
, UIResponder
var window: UIWindow?
main function of the app delegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
func applicationWillResignActive(_ application: UIApplication)
func applicationDidEnterBackground(_ application: UIApplication)
func applicationWillEnterForeground(_ application: UIApplication)
func applicationDidBecomeActive(_ application: UIApplication)
func applicationWillTerminate(_ application: UIApplication)
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)
private func setupDatabase(_ application: UIApplication) throws
func registerForPushNotifications()
func fetchFromFirebase()
Class for recording audio for alarm sound
class AudioRecordVC: RootViewController, AVAudioRecorderDelegate, AVAudioPlayerDelegate
RootViewController
, AVAudioPlayerDelegate
, AVAudioRecorderDelegate
var recordButton
let playButton
let instruction
let nextButton
var recordingSession: AVAudioSession!
var audioRecorder: AVAudioRecorder!
var audioPlayer: AVAudioPlayer?
var audioFilename: URL?
override func viewDidLoad()
loads the audio player to play the sound on device
func loadAudioPlayer()
Checks if the audio player finished playing the sound, then change the play button
func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool)
Loads the button button to record. Sets title and adds target
func loadRecordingUI()
Starts the recording session on device
func startRecording()
Gets the documents directory of the audio stored
func getDocumentsDirectory() -> URL
Finishes the recording session and clears memory to nil
func finishRecording(success: Bool)
Action for top left button when tapped. Takes the user back to the main vc
override func topLeftButtonTapped()
action for when the record button is tapped. Starts the audio session or stops
@objc func recordTapped()
Checks if the audio recorder did finish recording. Sets the flag according to that
func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool)
Uploads the recorded audio to firebase
func uploadToFirebase()
Setup function for play button on the view. Specifies the location, size and the syle of it
func playButtonSetup()
action for when play button is tapped. Plays the audio if not playing, stops the audio if playing
@objc func playButtonTapped()
Setup function for record button on the view. Specifies the location, size and the syle of it
func recordButtonSetup()
Setup function for instruction text view on the view. Specifies the location, size and the syle of it
func instructionTextViewSetup()
Setup function for next button on the view. Specifies the location, size and the syle of it
func nextButtonSetup()
Action for when next buton is tapped. Takes the usre to Main VC
@objc func nextButtonTapped()
View controller for create new alarm
class CreateNewAlarmVC: RootViewController, UITextFieldDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate
RootViewController
, UIImagePickerControllerDelegate
, UINavigationControllerDelegate
, UITextFieldDelegate
let saveButton
let deleteButton
let alarmNameLabel
let dateLabel
let timeLabel
let imageView
let imageButtonStack
let alarmNameTextField
let alarmDateTextField
let alarmTimeTextField
let statusLabel
let statusStatusLabel
var selectedTextField
let datePicker
let timePicker
let topImageView
let addImageButton
let vcName
let cameraButton
let imagePickerButton
let imageBackButton
var status
var editable
var screenName
var alarm
var image
override func viewDidLoad()
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
Setup function for image button stacks on the view. Specifies the location, size and the syle of it
func imageButtonStackSetup()
Setup function for top image view on the view. Specifies the location, size and the syle of it
func topImageViewSetup()
Setup function for add image button on the view. Specifies the location, size and the syle of it
func addImageButtonSetup()
action for when add image is tapped. Opens image picker
@objc func addImageTapped()
Setup function for camera button on the view. Specifies the location, size and the syle of it
func cameraButtonSetup()
action for when camera button is tapped. Opens the camera
@objc func cameraButtonTapped()
Setup function for image picker button on the view. Specifies the location, size and the syle of it
func imagePickerButtonSetup()
action for when image picker button is tapped. Set the image to be displayed
@objc func imagePickerButtonTapped()
Setup function for image back button on the view. Specifies the location, size and the syle of it
func imageBackButtonSetup()
action for when image back button is tapped.
@objc func imageBackButonTapped()
action for when top left button is clicked. Takes the user back to the previous screen
override func topLeftButtonTapped()
Setup function for view controller name on the view. Specifies the location, size and the syle of it
func vcNmaeSetup()
show the data in alarm textfield
func showData()
checks if the textfield did begin editing, set the inputview accordingly
func textFieldDidBeginEditing(_ textField: UITextField)
checks if textfield did end editing then format the date accordingly
func textFieldDidEndEditing(_ textField: UITextField)
shows the date picker on screen
func showDatePicker()
done editing the date picker
@objc func donedatePicker()
done editing the time picker
@objc func donetimePicker()
cancels editing the date picker
@objc func cancelDatePicker()
Setup function for alarm name text field on the view. Specifies the location, size and the syle of it
func alarmNameTextFieldSetup()
Setup function for alarm date text field on the view. Specifies the location, size and the syle of it
func alarmDateTextFieldSetup()
Setup function for alarm time textfield on the view. Specifies the location, size and the syle of it
func alarmTimeTextFieldSetup()
Setup function for alarm name label on the view. Specifies the location, size and the syle of it
func alarmNameLabelSetup()
Setup function for date label on the view. Specifies the location, size and the syle of it
func dateLabelSetup()
Setup function for time label on the view. Specifies the location, size and the syle of it
func timeLabelSetup()
action for when save button is clicked
@objc func backButtonClicked()
Setup function for save button on the view. Specifies the location, size and the syle of it
func saveButtonSetup()
action for when save button is clicked. Creates an alarm and send it to firebase
@objc func saveButtonClicked()
Setup function for lable for status label on the view. Specifies the location, size and the syle of it
func statusStatusLabelSetup()
view controller to show list of current alarms
class CurrentAlarmListVC: RootViewController, UITableViewDataSource, UITableViewDelegate
RootViewController
, UITableViewDataSource
, UITableViewDelegate
var activeAlarm
let alarmTable
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
override func viewDidLoad()
override func topLeftButtonTapped()
Setup function for alarm table on the view. Specifies the location, size and the syle of it
func alarmTableSetup()
fetch data from firebase
func fetchFromFirebase()
Current view controller that shows current alarms active
class CurrentAlarmViewVC: RootViewController, UITextFieldDelegate
RootViewController
, UITextFieldDelegate
let backButton
let saveButton
let deleteButton
let alarmDetailsLabel
let alarmNameLabel
let dateLabel
let timeLabel
let imageView
let alarmNameTextField
let alarmDateTextField
let alarmTimeTextField
let statusLabel
let statusStatusLabel
var selectedTextField
let datePicker
let timePicker
var status
var editable
var screenName
var alarm
override func viewDidLoad()
action for when top left button is tapped. Takes the user back to the previous screen.
override func topLeftButtonTapped()
Show the data in textviews
func showData()
Check if text view did beging editing, set the keyboard to date picker
func textFieldDidBeginEditing(_ textField: UITextField)
Checks if the text field did end editing. Formats the date accordingly and put on textview
func textFieldDidEndEditing(_ textField: UITextField)
Setup function for imageview on the view. Specifies the location, size and the syle of it
func imageViewSetup()
Setup function for date picker on the view. Specifies the location, size and the syle of it
func showDatePicker()
wrapper function for when date picker is done
@objc func donedatePicker()
wrapper function for when timer is done
@objc func donetimePicker()
wrapper function when cancel date
@objc func cancelDatePicker()
Setup function for alarm name textfield on the view. Specifies the location, size and the syle of it
func alarmNameTextFieldSetup()
Setup function for alarm date textfield on the view. Specifies the location, size and the syle of it
func alarmDateTextFieldSetup()
Setup function for alarm time text field on the view. Specifies the location, size and the syle of it
func alarmTimeTextFieldSetup()
Setup function for logo on the view. Specifies the location, size and the syle of it
func statusLabelSetup()
Setup function for alarm name label on the view. Specifies the location, size and the syle of it
func alarmNameLabelSetup()
Setup function for alarm details label on the view. Specifies the location, size and the syle of it
func alarmDetailsLabelSetup()
Setup function for date label on the view. Specifies the location, size and the syle of it
func dateLabelSetup()
Setup function for time label on the view. Specifies the location, size and the syle of it
func timeLabelSetup()
Setup function for back button on the view. Specifies the location, size and the syle of it
func backButtonSetup()
action for when button is clicked
@objc func backButtonClicked()
Setup function for save button on the view. Specifies the location, size and the syle of it
func saveButtonSetup()
action button for when save button is clicked. Updates data on firebase
@objc func saveButtonClicked()
actiong for when cancel button is clicked
@objc func cancelButtonClicked()
Setup function for delete button on the view. Specifies the location, size and the syle of it
func deleteButtonSetup()
action for when delete button is clicked. Send a request to firebase to delete the data
@objc func deleteButtonClicked()
Setup function for label for status lable on the view. Specifies the location, size and the syle of it
func statusStatusLabelSetup()
Controller for firebase actions
class FirebaseController
init()
upload image to firebase
func uploadImage(image: UIImage, imageName: String)
- Alarm
- AlarmDB
- AppDatabase
- AppDelegate
- AudioRecordVC
- CreateNewAlarmVC
- CurrentAlarmListVC
- CurrentAlarmViewVC
- FirebaseController
- MainVC
- PastAlarmListVC
- PastAlarmViewVC
- RootViewController
- RootViewController.ButtonType
- RootViewController.VCType
- SignInVC
- UserInfoVC
The main view controller of the app, users see this viewcontroller first when they open the app
class MainVC: RootViewController
let newAlarmButton
let viewAlarmButton
let pastAlarmsButton
let stack
let upperQuad
let lowerQuad
let secondTextView
override func viewDidLoad()
action for when the top left button is tapped. It prompts the user to record the alarm sound and preview it
override func topLeftButtonTapped()
Action for when the top right button is tapped. Here it logs out the user
override func topRightButtonTapped()
Setup function for second text view on the view. Specifies the location, size and the syle of it
func secondTextViewSetup()
Setup function for new alarm button on the view. Specifies the location, size and the syle of it
func newAlarmButtonSetup()
Action for when new alarm button is clicked. It takes the user to Create New Alarm View Controller
@objc func newAlarmButtonClicked()
Setup function for view alarm button on the view. Specifies the location, size and the syle of it
func viewAlarmButtonSetup()
action for when the view alarm button is clicked. Takes the user to Current Alarm ListVC
@objc func viewAlarmButtonClicked()
Setup function for past alarm button on the view. Specifies the location, size and the syle of it
func pastAlarmsButtonSetup()
Action for when past alarm button is clicked. Presents pastAlarmVC
@objc func pastAlarmButtonClicked()
View controller to show list of past alarms
class PastAlarmListVC: RootViewController, UITableViewDelegate, UITableViewDataSource
RootViewController
, UITableViewDataSource
, UITableViewDelegate
var inactiveAlarm
let backButton
let alarmTable
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
override func viewDidLoad()
action button for top left button. Takes the user back
override func topLeftButtonTapped()
Setup function for table view on the view. Specifies the location, size and the syle of it
func alarmTableSetup()
fetch data from firebase
func fetchFromFirebase()
View controller to show past alarms
class PastAlarmViewVC: RootViewController, UITextFieldDelegate
RootViewController
, UITextFieldDelegate
let backButton
let detailTextView
let cancelButton
let deleteButton
let alarmDetailsLabel
let alarmNameLabel
let dateLabel
let timeLabel
let imageView
let alarmNameTextField
let alarmDateTextField
let alarmTimeTextField
let statusLabel
let statusStatusLabel
var selectedTextField
var status
var editable
var screenName
var alarm
override func viewDidLoad()
action for when the top left button is tapped. Takes the user back to the previous view controller
override func topLeftButtonTapped()
Setup function for detail text view on the view. Specifies the location, size and the syle of it
func detailTextViewSetup()
prepares the data to be show on detail text view
func prepareDataforDetailTextView()
Setup function for image view on the view. Specifies the location, size and the syle of it
func imageViewSetup()
done function for when date picker is done
@objc func donedatePicker()
done function for when time picker is done
@objc func donetimePicker()
cancels the date picker
@objc func cancelDatePicker()
Setup function for alarm name text field on the view. Specifies the location, size and the syle of it
func alarmNameTextFieldSetup()
Setup function for alarm date text field on the view. Specifies the location, size and the syle of it
func alarmDateTextFieldSetup()
Setup function for alarm time text field on the view. Specifies the location, size and the syle of it
func alarmTimeTextFieldSetup()
Setup function for status label on the view. Specifies the location, size and the syle of it
func statusLabelSetup()
Setup function for alarm name label on the view. Specifies the location, size and the syle of it
func alarmNameLabelSetup()
Setup function for alarm detail lable on the view. Specifies the location, size and the syle of it
func alarmDetailsLabelSetup()
Setup function for date label on the view. Specifies the location, size and the syle of it
func dateLabelSetup()
Setup function for time label on the view. Specifies the location, size and the syle of it
func timeLabelSetup()
Setup function for cancel button on the view. Specifies the location, size and the syle of it
func cancelButtonSetup()
action for when cancel button is clicked
@objc func cancelButtonClicked()
Setup function for delete button on the view. Specifies the location, size and the syle of it
func deleteButtonSetup()
action place holder for delete button
@objc func deleteButtonClicked()
Setup function for status lable on the view. Specifies the location, size and the syle of it
func statusStatusLabelSetup()
class RootViewController: UIViewController
UIViewController
let topLeftButton
let topRightButton
let viewContollerLabel
let buttonStack
let topButtonSize
override func viewDidLoad()
func topLeftButtonSetup(buttonType: ButtonType)
@objc func topLeftButtonTapped()
func topRightButtonSetup(buttonType: ButtonType)
@objc func topRightButtonTapped()
func viewControllerLabelSetup(labelType: VCType)
func buttonStackSetup()
enum ButtonType
case rectangle
case square
enum VCType
case main
case sub
View controller to handle sign in functionalities
class SignInVC: UIViewController
UIViewController
let loginButton
let signUpButton
let guestButton
let emailTF
let passwordTF
let backButton
let logoImage
let errorMessageView
Attaches a user listener before the view appears
override func viewWillAppear(_ animated: Bool)
raises the view when the keyboard shows up
@objc func keyboardWillShow(notification: NSNotification)
lowers the view when the keyboard disappears
@objc func keyboardWillHide(notification: NSNotification)
override func viewDidLoad()
Setup function for logo on the view. Specifies the location, size and the syle of it
func logoImageSetup()
Setup function for login button on the view. Specifies the location, size and the syle of it
func loginButtonSetup()
action for when login button is tapped. Checks with firebase and logs the user in
@objc func loginButtonTapped()
Setup function for error mesage on the view. Specifies the location, size and the syle of it
func errorMessageViewSetup()
Setup function for signup button on the view. Specifies the location, size and the syle of it
func signUpButtonSetup()
action for when signup button is tapped. It registers the user on firebase
@objc func signUpButtonTapped()
Setup function for email textfield on the view. Specifies the location, size and the syle of it
func emailTFSetup()
Setup function for password textfield on the view. Specifies the location, size and the syle of it
func passwordTFSetup()
Setup function for back button on the view. Specifies the location, size and the syle of it
func backButtonSetup()
View controller that asks for user's information
class UserInfoVC: UIViewController, UITextFieldDelegate
UITextFieldDelegate
, UIViewController
let careTakerFirstNameTF
let careTakerLastNameTF
let patientFirstNameTF
let patientLastNameTF
let doneButton
let informationLabel
var selectedTextField
override func viewDidLoad()
Checks when the text field begins editing, assigns the responder based on that
func textFieldDidBeginEditing(_ textField: UITextField)
raises the view when keyboard appears
@objc func keyboardWillShow(notification: NSNotification)
lowers the view when keybaord disappers
@objc func keyboardWillHide(notification: NSNotification)
Setup function for information label on the view. Specifies the location, size and the syle of it
func informationLabelSetup()
Setup function for caretaker first name textfield on the view. Specifies the location, size and the syle of it
func careTakerFirstNameTFSetup()
Setup function for care taker last name textfield on the view. Specifies the location, size and the syle of it
func careTakerLastNameTFSetup()
Setup function for patient first name text field on the view. Specifies the location, size and the syle of it
func patientFirstNameTFSetup()
Setup function for patient last name text field on the view. Specifies the location, size and the syle of it
func patientLastNameTFSetup()
Setup function for done button on the view. Specifies the location, size and the syle of it
func doneButtonSetup()
action for when the done button is tapped. It uploads the data to firebase
@objc func doneButtonClicked()
Generated at 2020-05-02T13:30:21-0400 using swift-doc 1.0.0-beta.2.
Types
var dbQueue: DatabaseQueue!
var ref: DatabaseReference!
let userID