GameSettingsViewController
class GameSettingsViewController : UIViewController
Add sample doc for GameSetitngs
-
Profile Picker View
Declaration
Swift
@IBOutlet weak var profileBox: UITextField!
-
Music Track Picker
Declaration
Swift
@IBOutlet weak var musicTrackPicker: UIButton!
-
Beep Noise Declaration
Declaration
Swift
let countBeepPicker: UIPickerView
-
Beep Count
Declaration
Swift
@IBOutlet weak var beepCountSlider: UISlider!
-
Cane Legnth
Declaration
Swift
@IBOutlet weak var caneLengthSlider: UISlider!
-
Sweep Range
Declaration
Swift
@IBOutlet weak var sweepRangeSlider: UISlider!
-
Save button
Declaration
Swift
@IBOutlet weak var editSaveButton: UIButton!
-
Database of user information
Declaration
Swift
var dbInterface: <<error type>>
-
This function runs when the user selects the
Create Profile
option. It will- Open an alert to request the name of the profile
- When a name is entered, save the name with default settings in the database
- Reset the loaded name and options to the newly entered name
- Reload the pickerview to update the name and options
Declaration
Swift
@IBAction func newProfilePressed(_ sender: UIButton)
Parameters
sender
The UI button itself
-
This function runs when the user elects to change the song.
Declaration
Swift
@IBAction func chooseMusictrack(_ sender: Any)
Parameters
sender
The UI button itself
-
This function runs when the user changes the beep count slider. It will change the text on the screen and global variables to reflect the new value.
Declaration
Swift
@IBAction func beepCountChanged(_ sender: UISlider)
Parameters
sender
The UI Slider itself
-
This function runs when the user changes the sweep range slider. It will change the text on the screen and global variables to reflect the new value.
Declaration
Swift
@IBAction func sweepRangeChanged(_ sender: UISlider)
Parameters
sender
The UI Slider itself
-
This function runs when the user changes the can length slider. It will change the text on the screen and global variables to reflect the new value.
Declaration
Swift
@IBAction func caneLengthChanged(_ sender: UISlider)
Parameters
sender
The UI Slider itself
-
This function will disable and grey out all the user options on the screen
Declaration
Swift
func changeOptions(b: Bool)
Parameters
b
boolean whether or not to enable the options
-
This function will use the global variable
selectedProfile
to load a relevant settings for the selected user and update the UIDeclaration
Swift
func loadOptions()
-
This function runs when the user selects the edit/save button.
- If the button current says edit, it will ungrey and enable all the options
If the button says save, it will grey the boxes and save their current value in the database
Declaration
Swift
@IBAction func touchEditSave(_ sender: UIButton)
Parameters
sender
The UI button itself
-
This function runs when the the view loads (duh). It will
- Load the superview
- Load the side menu
- Populate the potential profiles
- Populate the beeps
- Disable the current options
- Load the current user and their options
Declaration
Swift
override func viewDidLoad()
Parameters
sender
The UI Slider itself
-
Defines a toolbar that enables you to pick from options and exit by selecting a done key
Declaration
Swift
func createToolbar()
-
When song is selected, save the data in the appropriate global variables.
Declaration
Swift
func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection)
-
return the number of options in the appropriate picker view
Declaration
Swift
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int
-
return the selected option from the right view
Declaration
Swift
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String?
-
Load the appropriate data whenever you mouse over a row
Declaration
Swift
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)