SmartPrompter Documentation Beta

Class Alarm​VC

class AlarmVC: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate

The alarm view controller that is show after a row on the table is tapped

%3 AlarmVC AlarmVC UINavigationControllerDelegate UINavigationControllerDelegate AlarmVC->UINavigationControllerDelegate UIViewController UIViewController AlarmVC->UIViewController UIImagePickerControllerDelegate UIImagePickerControllerDelegate AlarmVC->UIImagePickerControllerDelegate

Conforms To

UIImagePickerControllerDelegate
UINavigationControllerDelegate
UIViewController

Properties

back​Button

let backButton

save​Button

let saveButton

cancel​Button

let cancelButton

delete​Button

let deleteButton

button​Stack

let buttonStack

alarm​Details​Label

let alarmDetailsLabel

instruction​Label

let instructionLabel

date​Label

let dateLabel

time​Label

let timeLabel

alarm​Delegate

var alarmDelegate: AlarmVCDelegate?

alarm

var alarm

alarm​Name​Text​Field

let alarmNameTextField

alarm​Date​Text​Field

let alarmDateTextField

alarm​Time​Text​Field

let alarmTimeTextField

status​Label

let statusLabel

status​Status​Label

let statusStatusLabel

date​Picker

let datePicker

time​Picker

let timePicker

slider

let slider

picture​Slider

let pictureSlider

image​View

let imageView

notification​Title

var notificationTitle: Any?

taken​Image​Viewer

let takenImageViewer

alarm​Index

var alarmIndex

Methods

view​Did​Load()

override func viewDidLoad()

Main function of the view controller, all the important UI and rest of the alarm meta data are downloaded here.

image​View​Setup()

func imageViewSetup()

Sets up the size/location/shape and style of the imageview

show​Date​Picker()

func showDatePicker()

Sets up the size/location/shape and style of the date picker

taken​Image​View​Setup()

func takenImageViewSetup()

Sets up the size/location/shape and style of the imageview for take image

show​Time​Picker()

func showTimePicker()

Sets up the size/location/shape and style of the time picker

donedate​Picker()

@objc func donedatePicker()

action when done button is tapped on date picker

donetime​Picker()

@objc func donetimePicker()

action when done button is tapped on time picker

cancel​Date​Picker()

@objc func cancelDatePicker()

Action to cancel date picker and make it disappear

change​Value(_:​)

@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

sender UISlider

The slider object itself

change​Value​Picture​Slider(_:​)

@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

sender UISlider

The slider object itself

image​Picker​Controller(_:​did​Finish​Picking​Media​With​Info:​)

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

alarm​Date​Text​Field​Setup()

func alarmDateTextFieldSetup()

Sets up the size/location/shape and style of the alarm date text field

instruction​Label​Setup()

func instructionLabelSetup()

Sets up the size/location/shape and style of the instruction label

alarm​Details​Label​Setup()

func alarmDetailsLabelSetup()

Sets up the size/location/shape and style of the alarm details label

alarm​Name​Text​Field​Setup()

func alarmNameTextFieldSetup()

Sets up the size/location/shape and style of the alarm name text field

back​Button​Setup()

func backButtonSetup()

Sets up the size/location/shape and style of the back button

back​Button​Clicked()

@objc func backButtonClicked()

Action for back button when clicked, takes the user back to the previous screen

status​Status​Label​Setup()

func statusStatusLabelSetup()

Sets up the size/location/shape and style of the label for the status label

slider​Setup()

func sliderSetup()

Sets up the size/location/shape and style of the slider

picture​Slider​Setup()

func pictureSliderSetup()

Sets up the size/location/shape and style of the slider