Class
AlarmVC
class AlarmVC: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate
The alarm view controller that is show after a row on the table is tapped
Relationships
Conforms To
UIImagePickerControllerDelegate
UINavigationControllerDelegate
UIViewController
Properties
backButton
let backButton
saveButton
let saveButton
cancelButton
let cancelButton
deleteButton
let deleteButton
buttonStack
let buttonStack
alarmDetailsLabel
let alarmDetailsLabel
instructionLabel
let instructionLabel
dateLabel
let dateLabel
timeLabel
let timeLabel
alarmDelegate
var alarmDelegate: AlarmVCDelegate?
alarm
var alarm
alarmNameTextField
let alarmNameTextField
alarmDateTextField
let alarmDateTextField
alarmTimeTextField
let alarmTimeTextField
statusLabel
let statusLabel
statusStatusLabel
let statusStatusLabel
datePicker
let datePicker
timePicker
let timePicker
slider
let slider
pictureSlider
let pictureSlider
imageView
let imageView
notificationTitle
var notificationTitle: Any?
takenImageViewer
let takenImageViewer
alarmIndex
var alarmIndex
Methods
viewDidLoad()
override func viewDidLoad()
Main function of the view controller, all the important UI and rest of the alarm meta data are downloaded here.
imageViewSetup()
func imageViewSetup()
Sets up the size/location/shape and style of the imageview
showDatePicker()
func showDatePicker()
Sets up the size/location/shape and style of the date picker
takenImageViewSetup()
func takenImageViewSetup()
Sets up the size/location/shape and style of the imageview for take image
showTimePicker()
func showTimePicker()
Sets up the size/location/shape and style of the time picker
donedatePicker()
@objc func donedatePicker()
action when done button is tapped on date picker
donetimePicker()
@objc func donetimePicker()
action when done button is tapped on time picker
cancelDatePicker()
@objc func cancelDatePicker()
Action to cancel date picker and make it disappear
changeValue(_:)
@objc func changeValue(_ sender: UISlider)
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
Parameters
Name | Type | Description |
---|---|---|
sender | UISlider |
The slider object itself |
changeValuePictureSlider(_:)
@objc func changeValuePictureSlider(_ sender: UISlider)
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
Parameters
Name | Type | Description |
---|---|---|
sender | UISlider |
The slider object itself |
imagePickerController(_:didFinishPickingMediaWithInfo:)
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
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
alarmDateTextFieldSetup()
func alarmDateTextFieldSetup()
Sets up the size/location/shape and style of the alarm date text field
instructionLabelSetup()
func instructionLabelSetup()
Sets up the size/location/shape and style of the instruction label
alarmDetailsLabelSetup()
func alarmDetailsLabelSetup()
Sets up the size/location/shape and style of the alarm details label
alarmNameTextFieldSetup()
func alarmNameTextFieldSetup()
Sets up the size/location/shape and style of the alarm name text field
backButtonSetup()
func backButtonSetup()
Sets up the size/location/shape and style of the back button
backButtonClicked()
@objc func backButtonClicked()
Action for back button when clicked, takes the user back to the previous screen
statusStatusLabelSetup()
func statusStatusLabelSetup()
Sets up the size/location/shape and style of the label for the status label
sliderSetup()
func sliderSetup()
Sets up the size/location/shape and style of the slider
pictureSliderSetup()
func pictureSliderSetup()
Sets up the size/location/shape and style of the slider